first commit

This commit is contained in:
Bruno Rybársky 2022-02-23 12:02:00 +01:00
commit 4a77927779

32
bot.py Executable file

@ -0,0 +1,32 @@
def write_pid():
pid = os.getpid()
with open('/tmp/spam.pid', 'w') as f:
f.write(str(pid))
print('Hello my(i \'m spambot) pid is ' + str(pid))
write_pid()
from discord.ext import commands
import asyncio
client = commands.Bot(command_prefix="$")
@client.event
async def on_ready():
print("Potato is ready.")
@client.command(help='(what to spam) (interval(sec)) (how many times spam)')
@commands.has_permissions(administrator=True)
async def spamhere(ctx, what, interval, times):
try:
for i in range(int(times)):
await ctx.send(what)
await asyncio.sleep(int(interval))
except Exception as e:
await ctx.send(e)
with open("/home/git/spam_key") as tkn:
client.run(tkn.read())