fix bot taggable bypass

Kaveen Kumarasinghe 1 year ago
parent d1ea9868ad
commit f20687f3f3

@ -65,6 +65,7 @@ except Exception as e:
raise e
BOT_NAME = EnvService.get_custom_bot_name()
BOT_TAGGABLE_ROLES = EnvService.get_gpt_roles()
class GPT3ComCon(discord.Cog, name="GPT3ComCon"):
@ -626,6 +627,13 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"):
if not BOT_TAGGABLE:
return
# Check if any of the message author's role names are in BOT_TAGGABLE_ROLES, if not, return
if BOT_TAGGABLE_ROLES != [None] and not any(
role.name.lower() in BOT_TAGGABLE_ROLES
for role in message.author.roles
):
return
# Remove the mention from the message
prompt = message.content.replace(self.bot.user.mention, "")
# If the message is empty, don't process it

Loading…
Cancel
Save