mirror of
https://github.com/myned/modufur.git
synced 2024-11-01 21:02:38 +00:00
Insourced restart command
This commit is contained in:
parent
0ee61c8084
commit
48e442b5a2
2 changed files with 5 additions and 10 deletions
|
@ -1,3 +0,0 @@
|
|||
import os, sys
|
||||
|
||||
os.execl(sys.executable, 'python3', 'run.py')
|
|
@ -51,15 +51,13 @@ async def die(ctx):
|
|||
@checks.del_ctx()
|
||||
async def restart(ctx):
|
||||
try:
|
||||
if isinstance(bot.get_channel(config['startup_channel']), discord.TextChannel):
|
||||
await bot.get_channel(config['shutdown_channel']).send('Am :b: rite becc. **Have noon.** 💤')
|
||||
process = subprocess.run(['python3', 'restart.py'])
|
||||
print(process.returncode)
|
||||
await bot.close()
|
||||
print('RESTARTING')
|
||||
print('-------')
|
||||
print('Closed.')
|
||||
if isinstance(bot.get_channel(config['startup_channel']), d.TextChannel):
|
||||
await bot.get_channel(config['shutdown_channel']).send('**Restarting...** 💤')
|
||||
os.execl(sys.executable, 'python3', 'run.py')
|
||||
except Exception:
|
||||
await ctx.send(exc.base + '\n```python' + traceback.format_exc(limit=1) + '```')
|
||||
await ctx.send('{}\n```{}```'.format(exc.base, traceback.format_exc(limit=1)))
|
||||
traceback.print_exc(limit=1)
|
||||
|
||||
# Invite bot to bot owner's server
|
||||
|
|
Loading…
Reference in a new issue