mirror of
https://github.com/myned/modufur.git
synced 2024-12-24 22:27:28 +00:00
Add assignment of cogs to manageable variables
This commit is contained in:
parent
00be044033
commit
bab0900fde
1 changed files with 13 additions and 7 deletions
18
src/run.py
18
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']:
|
||||||
|
temp = bot.get_channel(channel)
|
||||||
|
bot.loop.create_task(cogs['Administration'].queue_for_deletion(temp))
|
||||||
|
print('RESTARTED : auto-deleting in #{}'.format(temp.name))
|
||||||
|
cogs['Administration'].deleting = True
|
||||||
|
bot.loop.create_task(cogs['Administration'].delete())
|
||||||
|
|
||||||
for cog in (tools.Utils(bot), owner.Bot(bot), owner.Tools(bot), management.Administration(bot), info.Info(bot), booru.MsG(bot)):
|
# if u.config['playing'] is not '':
|
||||||
bot.add_cog(cog)
|
# await bot.change_presence(game=d.Game(name=u.config['playing']))
|
||||||
print(f'COG : {type(cog).__name__}')
|
|
||||||
|
|
||||||
if u.config['playing'] is not '':
|
print('\nS U C C E S S\n')
|
||||||
await bot.change_presence(game=d.Game(name=u.config['playing']))
|
|
||||||
|
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
|
|
Loading…
Reference in a new issue