1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-12-23 22:27:27 +00:00

Remove close method entirely

This commit is contained in:
Dylan Dizon 2018-11-03 17:02:25 -04:00
parent e96d98aee8
commit 57431b8de5
2 changed files with 1 additions and 19 deletions

View file

@ -36,10 +36,9 @@ class Bot:
# loop = self.bot.loop.all_tasks()
# for task in loop:
# task.cancel()
await self.bot.logout()
u.close(self.bot.loop)
print('\n< < < < < < < < < < < <\nD I S C O N N E C T E D\n< < < < < < < < < < < <\n')
# u.notify('D I S C O N N E C T E D')
await self.bot.logout()
@cmds.command(name=',restart', aliases=[',res', ',r'], hidden=True)
@cmds.is_owner()
@ -58,7 +57,6 @@ class Bot:
# for task in loop:
# task.cancel()
await self.bot.logout()
u.close(self.bot.loop)
os.execl(sys.executable, 'python3', 'run.py')
# Invite bot to bot owner's server

View file

@ -116,22 +116,6 @@ async def fetch(url, *, params={}, json=False, response=False):
# obj = replace
# asyncio.sleep(interval)
def close(loop):
if session:
session.close()
loop.stop()
pending = asyncio.Task.all_tasks()
for task in pending:
task.cancel()
# with suppress(asyncio.CancelledError):
# loop.run_until_complete(task)
# loop.close()
print('Finished cancelling tasks.')
def generate_embed(ctx, *, title=d.Embed.Empty, kind='rich', description=d.Embed.Empty, url=d.Embed.Empty, timestamp=d.Embed.Empty, colour=color, footer={}, image=d.Embed.Empty, thumbnail=d.Embed.Empty, author={}, fields=[]):
embed = d.Embed(title=title, type=kind, description=description, url=url, timestamp=timestamp, colour=colour if isinstance(ctx.channel, d.TextChannel) else color)