'Making a discord spam bot using discord tokens with the new python rewrite
I would like to make a discord bot in the python rewrite. This bot will be a spam bot but I'm simply just don't know where to start. I have 4 previously made discord bots that are still all currently in development.
I tried to make usage of the self bot feature to no real avail. The bot right now can do some nmap scans accepting flags, dns enumeration, ping websites etc. Also WhatWaf. It runs on a 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.')
I want it to be able to use accounts from a discord token to spam other servers using an invite link.
Solution 1:[1]
I am not sure what you mean by "spam bot" but I assume that the bot will spam a message when it joins a guild.
Please look at the example bot.
You could use the on_guild_join event and go in every channel and spam your message.
Below is a example of what you want:
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"))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | MouseMoosz |
