add !stars
This commit is contained in:
parent
97da087115
commit
84310fc1a2
1 changed files with 16 additions and 0 deletions
16
commands.ts
16
commands.ts
|
@ -1,4 +1,5 @@
|
||||||
import type { Client, Message } from 'discord.js';
|
import type { Client, Message } from 'discord.js';
|
||||||
|
import fetch from 'node-fetch';
|
||||||
import pLimit from 'p-limit';
|
import pLimit from 'p-limit';
|
||||||
import { POLYCAT_CHANNEL_ID } from './constants';
|
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) => {
|
'!polycatgen': async (c, e) => {
|
||||||
if (!e.guild) return;
|
if (!e.guild) return;
|
||||||
if (e.channelId !== POLYCAT_CHANNEL_ID) return;
|
if (e.channelId !== POLYCAT_CHANNEL_ID) return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue