mirror of
https://github.com/myned/modufur.git
synced 2024-11-01 21:02:38 +00:00
Merge branch 'dev'
This commit is contained in:
commit
661194ea5d
1 changed files with 13 additions and 7 deletions
20
src/run.py
20
src/run.py
|
@ -74,8 +74,10 @@ async def on_ready():
|
||||||
|
|
||||||
from cogs import booru, info, management, owner, tools
|
from cogs import booru, info, management, owner, tools
|
||||||
|
|
||||||
|
cogs = {}
|
||||||
for cog in (tools.Utils(bot), owner.Bot(bot), owner.Tools(bot), management.Administration(bot), info.Info(bot), booru.MsG(bot)):
|
for cog in (tools.Utils(bot), owner.Bot(bot), owner.Tools(bot), management.Administration(bot), info.Info(bot), booru.MsG(bot)):
|
||||||
bot.add_cog(cog)
|
bot.add_cog(cog)
|
||||||
|
cogs[type(cog).__name__] = cog
|
||||||
print(f'COG : {type(cog).__name__}')
|
print(f'COG : {type(cog).__name__}')
|
||||||
|
|
||||||
# bot.loop.create_task(u.clear(booru.temp_urls, 30*60))
|
# bot.loop.create_task(u.clear(booru.temp_urls, 30*60))
|
||||||
|
@ -104,14 +106,18 @@ async def on_ready():
|
||||||
else:
|
else:
|
||||||
print('\n- - - -\nI N F O : reconnected, reinitializing\n- - - -')
|
print('\n- - - -\nI N F O : reconnected, reinitializing\n- - - -')
|
||||||
|
|
||||||
from cogs import booru, info, management, owner, tools
|
if u.tasks['auto_del']:
|
||||||
|
for channel in u.tasks['auto_del']:
|
||||||
for cog in (tools.Utils(bot), owner.Bot(bot), owner.Tools(bot), management.Administration(bot), info.Info(bot), booru.MsG(bot)):
|
temp = bot.get_channel(channel)
|
||||||
bot.add_cog(cog)
|
bot.loop.create_task(cogs['Administration'].queue_for_deletion(temp))
|
||||||
print(f'COG : {type(cog).__name__}')
|
print('RESTARTED : auto-deleting in #{}'.format(temp.name))
|
||||||
|
cogs['Administration'].deleting = True
|
||||||
|
bot.loop.create_task(cogs['Administration'].delete())
|
||||||
|
|
||||||
if u.config['playing'] is not '':
|
# if u.config['playing'] is not '':
|
||||||
await bot.change_presence(game=d.Game(name=u.config['playing']))
|
# await bot.change_presence(game=d.Game(name=u.config['playing']))
|
||||||
|
|
||||||
|
print('\nS U C C E S S\n')
|
||||||
|
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
|
|
Loading…
Reference in a new issue