Skip to content

Commit

Permalink
Allows factoid prefix longer than 1 character (#1087)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajax146 authored Jul 22, 2024
1 parent 4d2bd4d commit 593d05e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion techsupport_bot/commands/factoids.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,8 @@ async def response(
return
# Checks if the first word of the content after the prefix is a valid factoid
# Replaces \n with spaces so factoid can be called even with newlines
query = message_content[1:].replace("\n", " ").split(" ")[0].lower()
prefix = config.extensions.factoids.prefix.value
query = message_content[len(prefix) :].replace("\n", " ").split(" ")[0].lower()
try:
factoid = await self.get_factoid(query, str(ctx.guild.id))

Expand Down

0 comments on commit 593d05e

Please sign in to comment.