Skip to content

Commit

Permalink
fix lottie sticker bookmark
Browse files Browse the repository at this point in the history
  • Loading branch information
flowernal authored and solumath committed Aug 3, 2024
1 parent 3f39d02 commit de78b31
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cogs/bookmark/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ async def create_bookmark_embed(self, inter, title_name=None):

# create list of attachments
upload_limit = False
lottie_sticker = False
images = []
files_attached = []
if inter.message.attachments:
Expand All @@ -63,16 +64,23 @@ async def create_bookmark_embed(self, inter, title_name=None):

if inter.message.stickers:
for sticker in inter.message.stickers:
if sticker.format is disnake.StickerFormatType.lottie:
lottie_sticker = True
continue
files_attached.append(await sticker.to_file())

if len(content) > 1024:
parts = split_to_parts(content, 1024)
for msg in parts:
embed.add_field(name="Původní zpráva", value=msg, inline=False)
embed.add_field(name=MessagesCZ.original_message, value=msg, inline=False)
else:
embed.add_field(name="Původní zpráva", value=content, inline=False)
embed.add_field(name=MessagesCZ.original_message, value=content, inline=False)

if upload_limit:
embed.add_field(name="Poznámka", value=MessagesCZ.upload_limit, inline=False)
embed.add_field(name=MessagesCZ.bookmark_note, value=MessagesCZ.upload_limit, inline=False)

if lottie_sticker:
embed.add_field(name=MessagesCZ.bookmark_note, value=MessagesCZ.lottie_sticker, inline=False)

embed.add_field(name="Channel", value=f"{inter.message.channel.mention} - #{inter.message.channel}")
return ([embed], images, files_attached)
2 changes: 2 additions & 0 deletions cogs/bookmark/messages_cz.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
class MessagesCZ(GlobalMessages):
bookmark_title = "Záložka na serveru `{server}`"
bookmark_created = "Záložka `{title_name}` vytvořena"
bookmark_note = "Poznámka"
upload_limit = "Zpráva obsahuje přílohu přesahující upload limit, doporučuji si tuto přílohu stáhnout. V připadě smazání původní zprávy nebude příloha dostupná."
original_message = "Původní zpráva"
lottie_sticker = "Pokusil/a jsi se uložit výchozí Discord sticker. Tato API funkce nefunguje dobře a proto raději neposílám nic. Ulož si ji prosím jiným způsobem, pokud ji potřebuješ. <:KKomrade:484470873001164817>"

0 comments on commit de78b31

Please sign in to comment.