|
|
@@ -2,7 +2,6 @@
|
|
2
|
2
|
Cog for handling most ungrouped commands and basic behaviors.
|
|
3
|
3
|
"""
|
|
4
|
4
|
import re
|
|
5
|
|
-import traceback
|
|
6
|
5
|
from datetime import datetime, timedelta, timezone
|
|
7
|
6
|
from typing import Optional
|
|
8
|
7
|
|
|
|
@@ -12,7 +11,7 @@ from discord.ext import commands
|
|
12
|
11
|
|
|
13
|
12
|
from config import CONFIG
|
|
14
|
13
|
from rocketbot.cogs.basecog import BaseCog, BotMessage
|
|
15
|
|
-from rocketbot.utils import timedelta_from_str, describe_timedelta
|
|
|
14
|
+from rocketbot.utils import timedelta_from_str, describe_timedelta, dump_stacktrace
|
|
16
|
15
|
from rocketbot.storage import ConfigKey, Storage
|
|
17
|
16
|
|
|
18
|
17
|
class GeneralCog(BaseCog, name='General'):
|
|
|
@@ -53,13 +52,15 @@ class GeneralCog(BaseCog, name='General'):
|
|
53
|
52
|
"""Event handler"""
|
|
54
|
53
|
self.log(None, 'Bot done initializing')
|
|
55
|
54
|
self.is_ready = True
|
|
|
55
|
+ try:
|
|
|
56
|
+ synced_commands = await self.bot.tree.sync()
|
|
|
57
|
+ for command in synced_commands:
|
|
|
58
|
+ self.log(None, f'Synced command: {command.name}')
|
|
|
59
|
+ except Exception as e:
|
|
|
60
|
+ dump_stacktrace(e)
|
|
56
|
61
|
if self.is_first_ready:
|
|
57
|
62
|
print('----------------------------------------------------------')
|
|
58
|
63
|
self.is_first_ready = False
|
|
59
|
|
- try:
|
|
60
|
|
- await self.bot.tree.sync()
|
|
61
|
|
- except Exception as e:
|
|
62
|
|
- traceback.print_exception(type(e), e, e.__traceback__)
|
|
63
|
64
|
|
|
64
|
65
|
@commands.Cog.listener()
|
|
65
|
66
|
async def on_resumed(self):
|