fix: Update regex to capture custom emoji/sticker names with spaces and special characters

This commit is contained in:
Slipstream 2025-05-28 18:00:53 -06:00
parent 52e982518c
commit 1b022baf61
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD

View File

@ -1474,7 +1474,8 @@ async def get_ai_response(cog: 'GurtCog', message: discord.Message, model_name:
content_to_process = final_parsed_data["content"]
# Find all potential custom emoji/sticker names like :name:
# Use a non-greedy match for the name to avoid matching across multiple colons
potential_custom_items = re.findall(r':([\w\d_]+?):', content_to_process)
# Regex updated to capture names with spaces and other characters, excluding colons.
potential_custom_items = re.findall(r':([^:]+):', content_to_process)
modified_content = content_to_process
for item_name_key in potential_custom_items: