Skip to content

Commit 03fa816

Browse files
committed
updated donation embed
1 parent b6d4052 commit 03fa816

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

cogs/kofi/kofi_webhook.py

+7-12
Original file line numberDiff line numberDiff line change
@@ -614,20 +614,19 @@ async def process_kofi_data(self, kofi_data):
614614
# Set thumbnail
615615
embed.set_thumbnail(url=self.config["kofi_logo"])
616616

617-
# Add message or default text to description
618-
if kofi_data.get("message") and kofi_data["message"].strip():
619-
embed.description = f"\"{kofi_data['message']}\""
620-
elif is_subscription:
617+
# Add appropriate text to description
618+
if is_subscription:
619+
# For subscriptions, use a special message
621620
embed.description = f"**{kofi_data.get('from_name', self.t('Anonymous'))}** {self.t('has subscribed to the')} {kofi_data.get('tier_name', '')} {self.t('tier!')} 🎉"
622621
else:
623-
# Use custom message if available
622+
# For donations, always use custom message
624623
embed.description = self.t("CustomMessage")
625624

626625
# Set footer and timestamp
627626
footer_text = self.t("CustomFooter").replace(
628627
"{KOFI_NAME}", self.config["kofi_name"]
629628
)
630-
embed.set_footer(text=footer_text, icon_url=self.config["kofi_logo"])
629+
embed.set_footer(text=footer_text)
631630
# FIX: Use the correct UTC timestamp format
632631
embed.timestamp = datetime.datetime.now(datetime.timezone.utc)
633632

@@ -685,12 +684,8 @@ async def process_kofi_data(self, kofi_data):
685684
inline=False,
686685
)
687686

688-
# Add message as separate field if not used in description
689-
if (
690-
kofi_data.get("message")
691-
and kofi_data["message"].strip()
692-
and is_subscription
693-
):
687+
# Add message as a separate field if one was included
688+
if kofi_data.get("message") and kofi_data["message"].strip():
694689
embed.add_field(
695690
name=self.t("Message"), value=kofi_data["message"], inline=False
696691
)

0 commit comments

Comments
 (0)