Add: Cogs to be loaded on bot startup
Additionally: Fix class docstring and remove unused import
This commit is contained in:
+6
-7
@@ -1,11 +1,11 @@
|
||||
from discord.ext import commands
|
||||
import discord
|
||||
from utils.datetime_tools import get_elapsed_time_small, get_elapsed_time_milliseconds
|
||||
from utils.datetime_tools import get_elapsed_time_small
|
||||
from logging import Logger
|
||||
from datetime import datetime
|
||||
|
||||
class PostIt_Bot(commands.Bot):
|
||||
"""Class to extend the built-in """
|
||||
"""Class to extend the built-in bot class"""
|
||||
def __init__(self, startup_time:float, program_version:str, app_logger:Logger):
|
||||
intents = discord.Intents.default()
|
||||
intents.messages = True
|
||||
@@ -16,11 +16,10 @@ class PostIt_Bot(commands.Bot):
|
||||
self.__logger = app_logger
|
||||
|
||||
async def setup_hook(self):
|
||||
# # Register cogs to handle commands
|
||||
# for cog_name in ["debug", "post"]:
|
||||
# await self.load_extension(f"cogs.{cog_name}")
|
||||
# await self.tree.sync()
|
||||
pass
|
||||
# Register cogs to handle commands
|
||||
for cog_name in ["post", "reload"]:
|
||||
await self.load_extension(f"cogs.{cog_name}")
|
||||
await self.tree.sync()
|
||||
|
||||
async def on_ready(self):
|
||||
self.__logger.info(f"Successfully logged in (after {get_elapsed_time_small(datetime.now().timestamp() - self.startup_time)}) as {self.user}")
|
||||
|
||||
Reference in New Issue
Block a user