@@ -39,15 +39,15 @@ 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
4646 FUNCTIONS_DIR_NAME (str):The hardcoded folder for functions
4747 FUNCTIONS_DIR (str):The list of all files in the FUNCTIONS_DIR_NAME folder
4848 """
4949
50- CONFIG_PATH : str = " ./config.yml"
50+ CONFIG_PATH : str = os . environ . get ( "CONFIG_YML" , " ./config.yml")
5151 EXTENSIONS_DIR_NAME : str = "commands"
5252 EXTENSIONS_DIR : str = (
5353 f"{ os .path .join (os .path .dirname (__file__ ))} /{ EXTENSIONS_DIR_NAME } "
@@ -915,7 +915,7 @@ async def interaction_check(self: Self, interaction: discord.Interaction) -> boo
915915 await self .slash_command_log (interaction )
916916
917917 await self .logger .send_log (
918- message = "Checking if prefix command can run" ,
918+ message = "Checking if slash command can run" ,
919919 level = LogLevel .DEBUG ,
920920 context = LogContext (guild = interaction .guild , channel = interaction .channel ),
921921 console_only = True ,
@@ -1042,22 +1042,30 @@ async def can_run(
10421042 # IRC Stuff
10431043
10441044 async def start_irc (self : Self ) -> None :
1045- """Starts the IRC connection in a seperate thread"""
1046- irc_config = self .file_config .api .irc
1045+ """Starts the IRC bot in a separate thread."""
10471046 main_loop = asyncio .get_running_loop ()
1047+ irc_config = self .file_config .api .irc
10481048
1049- irc_bot = ircrelay .IRCBot (
1049+ # Create the bot instance
1050+ irc_bot = ircrelay .relay .IRCBot (
10501051 loop = main_loop ,
10511052 server = irc_config .server ,
10521053 port = irc_config .port ,
10531054 channels = irc_config .channels ,
10541055 username = irc_config .name ,
10551056 password = irc_config .password ,
10561057 )
1058+
10571059 self .irc = irc_bot
10581060
1059- irc_thread = threading .Thread (target = irc_bot .start )
1061+ def run_in_thread () -> None :
1062+ """Run the IRC bot in a separate thread."""
1063+ irc_bot .start_bot ()
1064+
1065+ # Start the bot in a new thread
10601066 await self .logger .send_log (
1061- message = "Logging in to IRC" , level = LogLevel .INFO , console_only = True
1067+ message = "Logging into IRC" , level = LogLevel .INFO , console_only = True
10621068 )
1063- irc_thread .start ()
1069+
1070+ bot_thread = threading .Thread (target = run_in_thread )
1071+ bot_thread .start ()
0 commit comments