@@ -39,7 +39,7 @@ class TechSupportBot(commands.Bot):
3939 allowed_mentions (discord.AllowedMentions): What the bot is, or is not,
4040 allowed to mention
4141
42- Attrs :
42+ Attributes :
4343 CONFIG_PATH (str): The hard coded path to the yaml config file
4444 EXTENSIONS_DIR_NAME (str): The hardcoded folder for commands
4545 EXTENSIONS_DIR (str): The list of all files in the EXTENSIONS_DIR_NAME folder
@@ -918,7 +918,7 @@ async def interaction_check(self: Self, interaction: discord.Interaction) -> boo
918918 await self .slash_command_log (interaction )
919919
920920 await self .logger .send_log (
921- message = "Checking if prefix command can run" ,
921+ message = "Checking if slash command can run" ,
922922 level = LogLevel .DEBUG ,
923923 context = LogContext (guild = interaction .guild , channel = interaction .channel ),
924924 console_only = True ,
@@ -1045,22 +1045,30 @@ async def can_run(
10451045 # IRC Stuff
10461046
10471047 async def start_irc (self : Self ) -> None :
1048- """Starts the IRC connection in a seperate thread"""
1049- irc_config = self .file_config .api .irc
1048+ """Starts the IRC bot in a separate thread."""
10501049 main_loop = asyncio .get_running_loop ()
1050+ irc_config = self .file_config .api .irc
10511051
1052- irc_bot = ircrelay .IRCBot (
1052+ # Create the bot instance
1053+ irc_bot = ircrelay .relay .IRCBot (
10531054 loop = main_loop ,
10541055 server = irc_config .server ,
10551056 port = irc_config .port ,
10561057 channels = irc_config .channels ,
10571058 username = irc_config .name ,
10581059 password = irc_config .password ,
10591060 )
1061+
10601062 self .irc = irc_bot
10611063
1062- irc_thread = threading .Thread (target = irc_bot .start )
1064+ def run_in_thread () -> None :
1065+ """Run the IRC bot in a separate thread."""
1066+ irc_bot .start_bot ()
1067+
1068+ # Start the bot in a new thread
10631069 await self .logger .send_log (
1064- message = "Logging in to IRC" , level = LogLevel .INFO , console_only = True
1070+ message = "Logging into IRC" , level = LogLevel .INFO , console_only = True
10651071 )
1066- irc_thread .start ()
1072+
1073+ bot_thread = threading .Thread (target = run_in_thread )
1074+ bot_thread .start ()
0 commit comments