Update guild2.py
This commit is contained in:
parent
664fab9d0f
commit
361b2fd4bb
1 changed files with 20 additions and 20 deletions
40
guild2.py
40
guild2.py
|
@ -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) != []:
|
||||
|
|
Loading…
Reference in a new issue