Refactor bot. (#8)
This commit is contained in:
parent
e0374bea36
commit
259d540e6f
18 changed files with 491 additions and 300 deletions
20
src/commands/stars.ts
Normal file
20
src/commands/stars.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { Command } from '../index';
|
||||
|
||||
export const cmd: Command = {
|
||||
name: 'stars',
|
||||
desc: 'Shows the number of stars in PolyMC',
|
||||
aliases: ['star', 'stargazers'],
|
||||
exec: async (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);
|
||||
return e.reply({
|
||||
embeds: [
|
||||
{
|
||||
title: `⭐ ${count} total stars!`,
|
||||
color: 'GOLD',
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue