feat: Support GIF format in sticker description generation
This commit is contained in:
parent
8856ff17e5
commit
0858185456
@ -311,7 +311,12 @@ class GurtCog(commands.Cog, name="Gurt"): # Added explicit Cog name
|
||||
print(f"Generating description for sticker: {sticker.name} (ID: {sticker.id}) in guild ID {guild_id}")
|
||||
description_to_add = "No description generated."
|
||||
if sticker.format == discord.StickerFormatType.png or sticker.format == discord.StickerFormatType.apng or sticker.format == discord.StickerFormatType.gif:
|
||||
mime_type = "image/png"
|
||||
format_to_mime = {
|
||||
discord.StickerFormatType.png: "image/png",
|
||||
discord.StickerFormatType.apng: "image/apng",
|
||||
discord.StickerFormatType.gif: "image/gif",
|
||||
}
|
||||
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."
|
||||
elif sticker.format == discord.StickerFormatType.lottie:
|
||||
|
Loading…
x
Reference in New Issue
Block a user