1
0
Fork 0

Update guild2.py

This commit is contained in:
Swee 2024-10-11 13:04:22 -07:00
parent 664fab9d0f
commit 361b2fd4bb

View file

@ -139,26 +139,26 @@ async def on_message(message):
else:
mess = await message.reply(embed=guilded.Embed(title=":sweebot-fail: Permission denied."))
print("[" + RED + "FAIL" + RESET + "] Not restarting script, Permission Denied for " + message.author.name)
elif command[0] == "spammy-shell":
if "full" in getperms(message.author.id):
mess = await message.reply("```No output (yet)```")
print("[" + BLUE + "..." + RESET + "] Running shell... (initiated by " + message.author.name + ")")
sleep(1)
p = subprocess.Popen(command[1:], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = ""
first = True
for line in iter(p.stdout.readline, b''):
if first:
await mess.edit("```" + line.decode().rstrip() +"```")
first = False
else:
await message.channel.send("```" + line.decode().rstrip() +"```")
p.stdout.close()
p.wait()
await message.channel.send("**Finished.**")
else:
mess = await message.reply(embed=guilded.Embed(title=":sweebot-fail: Permission denied."))
print("[" + RED + "FAIL" + RESET + "] Not restarting script, Permission Denied for " + message.author.name)
#elif command[0] == "spammy-shell":
# if "full" in getperms(message.author.id):
# mess = await message.reply("```No output (yet)```")
# print("[" + BLUE + "..." + RESET + "] Running shell... (initiated by " + message.author.name + ")")
# sleep(1)
# p = subprocess.Popen(command[1:], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
# output = ""
# first = True
# for line in iter(p.stdout.readline, b''):
# if first:
# await mess.edit("```" + line.decode().rstrip() +"```")
# first = False
# else:
# await message.channel.send("```" + line.decode().rstrip() +"```")
# p.stdout.close()
# p.wait()
# await message.channel.send("**Finished.**")
# else:
# mess = await message.reply(embed=guilded.Embed(title=":sweebot-fail: Permission denied."))
# print("[" + RED + "FAIL" + RESET + "] Not restarting script, Permission Denied for " + message.author.name)
elif command[0] == "whoami":
if getperms(message.author.id) != []: