fix: Update emoji and sticker description fallback to indicate potential AI filtering

This commit is contained in:
Slipstream 2025-05-29 11:48:38 -06:00
parent 0858185456
commit f07d569548
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD

View File

@ -280,14 +280,14 @@ class GurtCog(commands.Cog, name="Gurt"): # Added explicit Cog name
existing_emoji.get("id") == str(emoji.id) and \
existing_emoji.get("url") == emoji_url and \
existing_emoji.get("description") and \
existing_emoji.get("description") != "No description generated.":
existing_emoji.get("description") != "No description generated. (Likely was filtered by AI)":
# print(f"Skipping already processed emoji: {name_key} in guild {emoji.guild.name}")
return
print(f"Generating description for emoji: {name_key} in guild {emoji.guild.name}")
mime_type = "image/gif" if emoji.animated else "image/png"
description = await api.generate_image_description(self, emoji_url, emoji.name, "emoji", mime_type)
await self.emoji_manager.add_emoji(name_key, str(emoji.id), emoji.animated, guild_id, emoji_url, description or "No description generated.")
await self.emoji_manager.add_emoji(name_key, str(emoji.id), emoji.animated, guild_id, emoji_url, description or "No description generated. (Likely was filtered by AI)")
# await asyncio.sleep(1) # Rate limiting removed for faster parallel processing
except Exception as e:
print(f"Error processing single emoji {emoji.name} (ID: {emoji.id}) in guild {emoji.guild.name}: {e}")
@ -303,13 +303,12 @@ class GurtCog(commands.Cog, name="Gurt"): # Added explicit Cog name
if existing_sticker and \
existing_sticker.get("id") == str(sticker.id) and \
existing_sticker.get("url") == sticker_url and \
existing_sticker.get("description") and \
existing_sticker.get("description") not in ["No description generated.", "Lottie animation, visual description not applicable."]:
existing_sticker.get("description"):
# print(f"Skipping already processed sticker: {name_key} in guild ID {guild_id}")
return
print(f"Generating description for sticker: {sticker.name} (ID: {sticker.id}) in guild ID {guild_id}")
description_to_add = "No description generated."
description_to_add = "No description generated. (Likely was filtered by AI)"
if sticker.format == discord.StickerFormatType.png or sticker.format == discord.StickerFormatType.apng or sticker.format == discord.StickerFormatType.gif:
format_to_mime = {
discord.StickerFormatType.png: "image/png",
@ -318,7 +317,7 @@ class GurtCog(commands.Cog, name="Gurt"): # Added explicit Cog name
}
mime_type = format_to_mime.get(sticker.format, "image/png")
description = await api.generate_image_description(self, sticker_url, sticker.name, "sticker", mime_type)
description_to_add = description or "No description generated."
description_to_add = description or "No description generated. (Likely was filtered by AI)"
elif sticker.format == discord.StickerFormatType.lottie:
description_to_add = "Lottie animation, visual description not applicable."
else: