From 9207a3197d884eba8a5d2a4aa74404d68b333b85 Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Sun, 7 Jun 2026 15:12:02 -0700 Subject: [PATCH 1/9] Fix bug with loop cog --- techsupport_bot/core/cogs.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/techsupport_bot/core/cogs.py b/techsupport_bot/core/cogs.py index 3038a938..0cacd5f3 100644 --- a/techsupport_bot/core/cogs.py +++ b/techsupport_bot/core/cogs.py @@ -342,10 +342,11 @@ async def _loop_execute( if guild and guild not in self.bot.guilds: break - channels_list = configuration.get_config_entry( - guild.id, self.CHANNELS_KEY - ) - if not channels_list: + try: + channels_list = configuration.get_config_entry( + guild.id, self.CHANNELS_KEY + ) + except AttributeError: channels_list = [] if target_channel and str(target_channel.id) not in channels_list: From 9fc9d804d504b9d8f1667b76166a8fad2665b942 Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Sun, 7 Jun 2026 15:21:17 -0700 Subject: [PATCH 2/9] Fix some bugs with config reset --- techsupport_bot/commands/config.py | 4 +++- techsupport_bot/commands/extension.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/techsupport_bot/commands/config.py b/techsupport_bot/commands/config.py index e9f8470e..9c5e1397 100644 --- a/techsupport_bot/commands/config.py +++ b/techsupport_bot/commands/config.py @@ -279,9 +279,11 @@ async def reset_config(self: Self, interaction: discord.Interaction) -> None: Args: interaction (discord.Interaction): The interaction that triggered the slash command """ + await interaction.response.defer() view = ui.Confirm() await view.send( message=f"Are you sure you want to reset the config for {interaction.guild.name}?", + channel=interaction.channel, author=interaction.user, interaction=interaction, ) @@ -303,4 +305,4 @@ async def reset_config(self: Self, interaction: discord.Interaction) -> None: embed = auxiliary.prepare_confirm_embed( message="I've reset the config for this guild" ) - view.followup.send(embed=embed) + await view.followup.send(embed=embed) diff --git a/techsupport_bot/commands/extension.py b/techsupport_bot/commands/extension.py index 1cee1d43..825b6f73 100644 --- a/techsupport_bot/commands/extension.py +++ b/techsupport_bot/commands/extension.py @@ -211,11 +211,12 @@ async def register_extension( extension_name (str): the name of the extension extension_file (discord.Attachment): The python file of the extension """ + await interaction.response.defer() if not extension_file.filename.endswith(".py"): embed = auxiliary.prepare_deny_embed( message="I don't recognize your upload as a Python file", ) - await interaction.response.send_message(embed=embed) + await interaction.followup.send(embed=embed) return if extension_name.lower() in await self.bot.get_potential_extensions(): From b56594df57b35dc6f22c6e85a83b718e73ae7bb5 Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Sun, 7 Jun 2026 15:27:43 -0700 Subject: [PATCH 3/9] Add check for suggested words in dictionary --- techsupport_bot/commands/dictionary.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/techsupport_bot/commands/dictionary.py b/techsupport_bot/commands/dictionary.py index 69209dc2..23566eea 100644 --- a/techsupport_bot/commands/dictionary.py +++ b/techsupport_bot/commands/dictionary.py @@ -66,15 +66,21 @@ async def dictionary_lookup( response = await self.bot.http_functions.http_call("get", url) if not response: embed = auxiliary.prepare_deny_embed( - f"I could not find any definition for `{word}`" + f"I could not find any information for `{word}`" ) await interaction.followup.send(embed=embed) return - definition = response[0].shortdef - - embed = discord.Embed(title=f"Definition of `{word}`") - embed.color = discord.Color.orange() - embed.description = "\n".join(f"- {string}" for string in definition) + try: + definition = response[0].shortdef + embed = discord.Embed(title=f"Definition of `{word}`") + embed.color = discord.Color.orange() + embed.description = "\n".join(f"- {string}" for string in definition) + except AttributeError: + embed = discord.Embed( + title=f"The word `{word}` was not found. Did you mean:" + ) + embed.description = ", ".join(response) + embed.color = discord.Color.orange() await interaction.followup.send(embed=embed) From dcfae9ee5fc64c7c51090975952b7150636aadfe Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Sun, 7 Jun 2026 15:59:13 -0700 Subject: [PATCH 4/9] Fix bug with duck spawn --- techsupport_bot/commands/duck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/techsupport_bot/commands/duck.py b/techsupport_bot/commands/duck.py index c22690c7..8b6f088a 100644 --- a/techsupport_bot/commands/duck.py +++ b/techsupport_bot/commands/duck.py @@ -899,7 +899,7 @@ async def spawn(self: Self, ctx: commands.Context) -> None: spawn_user = configuration.get_config_entry(ctx.guild.id, "duck_spawn_user") for person in spawn_user: if ctx.author.id == int(person): - await self.execute(ctx.guild, ctx.channel) + await self.execute(ctx.guild, ctx.channel, ctx.author) return await auxiliary.send_deny_embed( message="It looks like you don't have permissions to spawn a duck", From d51053fe345c3aecbd03dfea56ce391713988bcf Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Sun, 7 Jun 2026 17:02:33 -0700 Subject: [PATCH 5/9] Fix 3 bugs in register_extension --- techsupport_bot/commands/extension.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/techsupport_bot/commands/extension.py b/techsupport_bot/commands/extension.py index 825b6f73..3373af35 100644 --- a/techsupport_bot/commands/extension.py +++ b/techsupport_bot/commands/extension.py @@ -224,6 +224,7 @@ async def register_extension( await view.send( message=f"Warning! This will replace the current `{extension_name}.py` " + "extension! Are you SURE?", + channel=interaction.channel, author=interaction.user, interaction=interaction, ) @@ -240,10 +241,10 @@ async def register_extension( fp = await extension_file.read() await self.bot.register_file_extension(extension_name, fp) - embed = auxiliary.send_confirm_embed( + embed = auxiliary.prepare_confirm_embed( message="I've registered that extension. You can now try loading it", ) - await view.followup.send(embed=embed) + await interaction.followup.send(embed=embed) return async def does_extension_exist(self: Self, extension_name: str) -> bool: From 3c65e7dcf625fe50d4549b7ebe43828e7cab86d5 Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Sun, 7 Jun 2026 17:11:48 -0700 Subject: [PATCH 6/9] Fix minor bug in factoid call --- techsupport_bot/commands/factoids.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/techsupport_bot/commands/factoids.py b/techsupport_bot/commands/factoids.py index 8fd993e4..db55a5a2 100644 --- a/techsupport_bot/commands/factoids.py +++ b/techsupport_bot/commands/factoids.py @@ -1028,6 +1028,8 @@ async def factoid_call_command( content = factoid.message if member_to_ping: + if not content: + content = "" content = f"{member_to_ping.mention} {content}".strip() if content and len(content) > 2000: From 80f065f411c0d3255e255ff2f523f4bd9a829bfc Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Sun, 7 Jun 2026 18:11:43 -0700 Subject: [PATCH 7/9] Fix bug with IRC automod --- techsupport_bot/commands/relay.py | 2 ++ techsupport_bot/configuration/config.default.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/techsupport_bot/commands/relay.py b/techsupport_bot/commands/relay.py index 91d72ad3..ad0bef05 100644 --- a/techsupport_bot/commands/relay.py +++ b/techsupport_bot/commands/relay.py @@ -411,6 +411,8 @@ async def send_message_from_irc(self: Self, split_message: dict[str, str]) -> No if "automod" in configuration.get_config_entry( discord_channel.guild.id, "core_enabled_extensions" + ) and str(discord_channel.id) in configuration.get_config_entry( + discord_channel.guild.id, "automod_channels" ): automod_actions = automod.run_only_string_checks( discord_channel.guild, split_message["content"] diff --git a/techsupport_bot/configuration/config.default.json b/techsupport_bot/configuration/config.default.json index f578e87e..e0c90ef2 100644 --- a/techsupport_bot/configuration/config.default.json +++ b/techsupport_bot/configuration/config.default.json @@ -82,7 +82,7 @@ "modmail_modmail_roles": [], "modmail_roles_to_ping": [], "modmail_thread_creation_message": "Create modmail thread?", - "news_category": "", + "news_category": "general", "news_channel": "", "news_country": "US", "news_cron_config": "0 17 * * *", From 4fbaaf2cea522e2aa3db9b02f319854205fe625e Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Sun, 7 Jun 2026 18:22:05 -0700 Subject: [PATCH 8/9] Fix bugs with calling the make_request function in search.py --- techsupport_bot/commands/search.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/techsupport_bot/commands/search.py b/techsupport_bot/commands/search.py index 62211091..ec9d218c 100644 --- a/techsupport_bot/commands/search.py +++ b/techsupport_bot/commands/search.py @@ -46,7 +46,7 @@ class WebSearcher(cogs.BaseCog): name="search", description="Command Group for the Search Extension" ) - async def make_reqest(self: Self, query: str) -> munch.Munch: + async def make_request(self: Self, query: str) -> munch.Munch: """This functions make a request to the Tavily API This pulls the API key from the config and returns a munch.Munch result @@ -94,7 +94,7 @@ async def websearch_text( query (str): The string query passed in by the user """ await interaction.response.defer() - response = self.make_request(query) + response = await self.make_request(query) embeds = [] @@ -134,7 +134,7 @@ async def websearch_image( query (str): The string query passed in by the user """ await interaction.response.defer() - response = self.make_request(query) + response = await self.make_request(query) embeds = [] From 3326d3ec94bdc53fef7d1c184bf397c92e7bbd74 Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Sun, 7 Jun 2026 18:32:44 -0700 Subject: [PATCH 9/9] Fix bug with autoreact --- techsupport_bot/functions/autoreact.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/techsupport_bot/functions/autoreact.py b/techsupport_bot/functions/autoreact.py index d431954d..b19dc301 100644 --- a/techsupport_bot/functions/autoreact.py +++ b/techsupport_bot/functions/autoreact.py @@ -60,5 +60,5 @@ async def response( if f" {word.lower()} " in search_content: reaction = reaction_map.get(word) if reaction not in reactions: - reactions.append(reaction_map.value.get(word)) + reactions.append(reaction_map.get(word)) await auxiliary.add_list_of_reactions(message=ctx.message, reactions=reactions)