2023-03-15 14:09:09 +00:00
|
|
|
import { request } from "undici";
|
|
|
|
import Command from "../../classes/command.js";
|
|
|
|
|
|
|
|
class DonateCommand extends Command {
|
2023-03-19 05:10:48 +00:00
|
|
|
static category = "general"
|
2023-03-15 14:09:09 +00:00
|
|
|
async run() {
|
2023-03-17 00:23:01 +00:00
|
|
|
// await this.acknowledge();
|
2023-03-15 14:09:09 +00:00
|
|
|
let prefix = "";
|
|
|
|
const controller = new AbortController();
|
|
|
|
const timeout = setTimeout(() => {
|
|
|
|
controller.abort();
|
|
|
|
}, 5000);
|
|
|
|
try {
|
|
|
|
const patrons = await request("https://projectlounge.pw/patrons", { signal: controller.signal }).then(data => data.body.json());
|
|
|
|
clearTimeout(timeout);
|
|
|
|
prefix = "Thanks to the following patrons for their support:\n";
|
|
|
|
for (const patron of patrons) {
|
|
|
|
prefix += `**- ${patron}**\n`;
|
|
|
|
}
|
|
|
|
prefix += "\n";
|
|
|
|
} catch (e) {
|
|
|
|
// no-op
|
|
|
|
}
|
2023-03-17 05:55:25 +00:00
|
|
|
return `${prefix}Like esmBot (or mrmBot)? Consider supporting Essem on Patreon to help keep it running! https://patreon.com/TheEssem`;
|
2023-03-15 14:09:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static description = "Learn more about how you can support esmBot's development";
|
|
|
|
static aliases = ["support", "patreon", "patrons"];
|
|
|
|
}
|
|
|
|
|
2021-08-19 14:19:14 +00:00
|
|
|
export default DonateCommand;
|