From 32092343b31c7fc3430bf8777cb490cb57e7dc8f Mon Sep 17 00:00:00 2001 From: Essem Date: Mon, 25 May 2026 15:34:05 -0500 Subject: [PATCH] feat: Use embed and new endpoint for donate command --- commands/general/donate.js | 32 ++++++++++++++++++++++++++------ locales/en-US.json | 5 +++-- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/commands/general/donate.js b/commands/general/donate.js index 7dab3c24..46c85d4e 100644 --- a/commands/general/donate.js +++ b/commands/general/donate.js @@ -4,25 +4,45 @@ import logger from "#utils/logger.js"; class DonateCommand extends Command { async run() { await this.acknowledge(); - let prefix = ""; + let desc = ""; const controller = new AbortController(); const timeout = setTimeout(() => { controller.abort(); }, 5000); try { - const patrons = await fetch("https://projectlounge.pw/patrons", { signal: controller.signal }).then((data) => + const patrons = await fetch("https://esmbot.net/patrons", { signal: controller.signal }).then((data) => data.json(), ); clearTimeout(timeout); - prefix = this.getString("commands.responses.donate.thanks"); for (const patron of patrons) { - prefix += `\n**- ${patron}**`; + desc += `\n- **${patron}**`; } - prefix += "\n"; } catch (e) { logger.error(`Unable to get patron data: ${e}`); } - return `${prefix}\n${this.getString("commands.responses.donate.support")} https://patreon.com/TheEssem`; + return { + embeds: [ + { + author: { + name: this.getString("commands.responses.donate.thanks"), + iconURL: this.client.user.avatarURL(), + }, + color: 0xff0000, + description: desc, + fields: [ + { + name: this.getString("commands.responses.donate.like"), + value: this.getString("commands.responses.donate.support", { + params: { + patreon: "https://patreon.com/TheEssem", + kofi: "https://ko-fi.com/TheEssem", + }, + }), + }, + ], + }, + ], + }; } static description = "Learn more about how you can support esmBot's development"; diff --git a/locales/en-US.json b/locales/en-US.json index 9a4e4e2a..7dd7bb9f 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -533,7 +533,7 @@ "remove": "Remove a role from the allowlist" }, "tags role add": { - "role": "The role to add" + "role": "The role to add" }, "tags role remove": { "role": "The role to remove" @@ -792,7 +792,8 @@ "error": "I couldn't get a dog image in time. Maybe try again?" }, "donate": { - "support": "Like esmBot? Consider supporting the developer on Patreon to help keep it running!", + "like": "Like esmBot?", + "support": "Consider supporting the developer on [Patreon]({{patreon}}) or [Ko-fi]({{kofi}}) to help keep it running!", "thanks": "Thanks to the following patrons for their support:" }, "emote": { -- 2.51.2