Skip to content

Commit

Permalink
fixed restart module
Browse files Browse the repository at this point in the history
Signed-off-by: Udith <[email protected]>
  • Loading branch information
uaudith committed Mar 27, 2020
1 parent 17d6eef commit 40e09a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions userge/plugins/utils/restart.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@

@userge.on_cmd('restart', about="__Restarts the bot and load all plugins__")
async def restart_cmd_handler(m: Message):
await m.reply("Restarting Userge Services")
await m.edit("Restarting Userge Services")
LOG.info(f"USERGE Services - Restart initiated")
asyncio.create_task(restart(userge, m))


async def restart(c: userge, m: Message):
await c.restart()
await c.stop()
await c.reload_plugins()
await c.start()
await m.edit(f"USERGE Services have been Restarted!")
LOG.info(f"USERGE - Restarted")

0 comments on commit 40e09a0

Please sign in to comment.