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