python - 通过新的 python 重写使用不和谐令牌制作不和谐垃圾邮件机器人
问题描述
我想在 python 重写中制作一个不和谐的机器人。这个机器人将是一个垃圾邮件机器人,但我只是不知道从哪里开始。我有 4 个之前制作的不和谐机器人,目前仍在开发中。
我试图利用自我机器人功能无济于事。该机器人现在可以进行一些 nmap 扫描,接受标志、dns 枚举、ping 网站等。还有 WhatWaf。它在 VPS 上运行。
@client.command()
async def nmap(ctx, *, arg):
async with ctx.typing():
allowed_chars = set('abcdefghijklmnopqrstuvwxuzABCDEFGHIJKLMNOPQRSTUVWXYZ0987654321.-')
if set(arg).issubset(allowed_chars):
stdoutdata = subprocess.getoutput("nmap " + arg)
#await ctx.send(stdoutdata)
embed = discord.Embed(description=stdoutdata, color=0x0FF00)
await ctx.send(embed=embed)
else:
await ctx.send('Nope.')
@client.command()
async def whatwaf(ctx, *, arg):
async with ctx.typing():
allowed_chars = set('abcdefghijklmnopqrstuvwxuzABCDEFGHIJKLMNOPQRSTUVWXYZ0987654321.-')
if set(arg).issubset(allowed_chars):
stdoutdata = subprocess.getoutput("wafw00f " + arg)
#await ctx.send(stdoutdata)
embed = discord.Embed(description=stdoutdata, color=0x0FF00)
await ctx.send(embed=embed)
else:
await ctx.send('Nope.')
@client.command()
async def dnsenum(ctx, *, arg):
async with ctx.typing():
allowed_chars = set('abcdefghijklmnopqrstuvwxuzABCDEFGHIJKLMNOPQRSTUVWXYZ0987654321.-')
if set(arg).issubset(allowed_chars):
stdoutdata = subprocess.getoutput("dnsenum --enum " + arg)
#await ctx.send(stdoutdata)
embed = discord.Embed(description=stdoutdata, color=0x0FF00)
await ctx.send(embed=embed)
else:
await ctx.send('Nope.')
我希望它能够使用来自不和谐令牌的帐户使用邀请链接向其他服务器发送垃圾邮件。
解决方案
我不确定您所说的“垃圾邮件机器人”是什么意思,但我认为该机器人在加入公会时会发送垃圾邮件。
请查看示例机器人。
您可以使用on_guild_join 事件并进入每个频道并发送垃圾邮件。
以下是您想要的示例:
import nextcord
from nextcord.ext import commands
from os import getenv # To get the env vars for retriving bot token
bot = commands.Bot(command_prefix = "!") # Initialize your bot
@bot.event # Not required, but good to have for information about the status of the bot
async def on_ready():
print(f"Logged in as {bot.user} ({bot.user.id}).")
@bot.event
async def on_guild_join(guild):
for i in range(49): # Replace 50 with the amount of messages you want to send per channel
for channel in guild.channels:
await channel.send("I am a spam bot, kick me for your saftey!") # Replace this with your message
bot.run(getenv("TOKEN"))
推荐阅读
- python - 如何将pandas数据框中多列的汇总汇总信息作为字符串列表?
- mysql - 将 varchar 时间戳字段转换为实际日期字段
- excel - VBA Excel - 使用部分更改的名称保存文件名
- php - PHP - 根据日期和时间对数组数据进行排序
- android - 如何在 Firebase auth UI Android 中添加自定义字段和业务逻辑?
- xamarin.forms - Xamarin 水平集合视图与 peakareinset
- python - 在 Spyder (Anaconda) 中安装库
- xml - 使用 xq 和 jq 将 XML 解析为 CSV
- bootstrap-table - 引导表按日期 dd/mm/yyy 排序
- tensorflow2.0 - Tensorflow 2 - AttributeError:'_NestedVariant'对象没有属性'batch'