diff --git a/commands.ts b/commands.ts index ee1b102..b8193c9 100644 --- a/commands.ts +++ b/commands.ts @@ -1,4 +1,5 @@ import type { Client, Message } from 'discord.js'; +import fetch from 'node-fetch'; import pLimit from 'p-limit'; import { POLYCAT_CHANNEL_ID } from './constants'; @@ -100,6 +101,21 @@ We probably can't fully fix this. If you find out which mod is causing this, tel }); }, + '!stars': async (c, e) => { + const count = await fetch('https://api.github.com/repos/PolyMC/PolyMC') + .then((r) => r.json() as Promise<{ stargazers_count: number }>) + .then((j) => j.stargazers_count); + + await e.reply({ + embeds: [ + { + title: `⭐ ${count} total stars!`, + color: 'GOLD', + }, + ], + }); + }, + '!polycatgen': async (c, e) => { if (!e.guild) return; if (e.channelId !== POLYCAT_CHANNEL_ID) return;