From 147e0d68f4f080fb461dd4edcf7a8091474faa85 Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Mon, 13 Apr 2026 20:58:19 -0700 Subject: [PATCH 1/2] Fixes some bugs in the XP system --- techsupport_bot/functions/xp.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/techsupport_bot/functions/xp.py b/techsupport_bot/functions/xp.py index ba8ce034..9382763a 100644 --- a/techsupport_bot/functions/xp.py +++ b/techsupport_bot/functions/xp.py @@ -29,6 +29,13 @@ async def setup(bot: bot.TechSupportBot) -> None: description="List of category IDs to count for XP", default=[], ) + config.add( + key="excluded_channels", + datatype="list", + title="List of channel IDs to exclude for XP", + description="List of channel IDs to exclude for XP", + default=[], + ) config.add( key="level_roles", datatype="dict", @@ -75,6 +82,10 @@ async def match( if ctx.channel.category_id not in config.extensions.xp.categories_counted.value: return False + # Ignore messages in exlucded channels + if ctx.channel.id in config.extensions.xp.excluded_channels.value: + return False + # Ignore messages that are too short if len(ctx.message.clean_content) < 20: return False @@ -87,7 +98,7 @@ async def match( # Ignore messages that are factoid calls if "factoids" in config.enabled_extensions: - factoid_prefix = prefix = config.extensions.factoids.prefix.value + factoid_prefix = config.extensions.factoids.prefix.value if ctx.message.clean_content.startswith(factoid_prefix): return False From b9e065e07c6a683777d8198f29a98afdad39b006 Mon Sep 17 00:00:00 2001 From: ajax146 <31014239+ajax146@users.noreply.github.com> Date: Mon, 13 Apr 2026 23:25:07 -0700 Subject: [PATCH 2/2] Fix bux with ineligible list --- techsupport_bot/functions/xp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/techsupport_bot/functions/xp.py b/techsupport_bot/functions/xp.py index 9382763a..94e7ce1e 100644 --- a/techsupport_bot/functions/xp.py +++ b/techsupport_bot/functions/xp.py @@ -75,7 +75,7 @@ async def match( return False # Ignore anyone in the ineligible list - if ctx.author.id in self.ineligible: + if f"{ctx.guild.id}:{ctx.author.id}" in self.ineligible: return False # Ignore messages outside of tracked categories @@ -131,7 +131,7 @@ async def response( await self.apply_level_ups(ctx.author, (current_XP + new_XP)) - self.ineligible[ctx.author.id] = True + self.ineligible[f"{ctx.guild.id}:{ctx.author.id}"] = True async def apply_level_ups(self: Self, user: discord.Member, new_xp: int) -> None: """This function will determine if a user leveled up and apply the proper roles