various changes to bot

This commit is contained in:
Ryan Cao 2022-10-18 17:42:04 +08:00
parent a55623fa68
commit 622cbab216
No known key found for this signature in database
5 changed files with 8 additions and 13 deletions

View file

@ -15,12 +15,7 @@ export const membersCommand = async (
{ {
title: `${memes.length} total members!`, title: `${memes.length} total members!`,
description: `${ description: `${
memes.filter( memes.filter((m) => m.presence?.status !== 'offline').length
(m) =>
m.presence?.status === 'online' ||
m.presence?.status === 'idle' ||
m.presence?.status === 'dnd'
).length
} online members`, } online members`,
color: COLORS.blue, color: COLORS.blue,
}, },

View file

@ -6,6 +6,7 @@ export const starsCommand = async (
) => { ) => {
await i.deferReply(); await i.deferReply();
/* CHANGEME */
const count = await fetch('https://api.github.com/repos/PolyMC/PolyMC') const count = await fetch('https://api.github.com/repos/PolyMC/PolyMC')
.then((r) => r.json() as Promise<{ stargazers_count: number }>) .then((r) => r.json() as Promise<{ stargazers_count: number }>)
.then((j) => j.stargazers_count); .then((j) => j.stargazers_count);

View file

@ -25,10 +25,5 @@ export const COLORS = {
orange: 0xfb923c, orange: 0xfb923c,
} as const; } as const;
export const ALLOWED_ROLES = [ /* CHANGEME */
'Alert', export const ALLOWED_ROLES = ['Alert', 'Events', 'Progress'];
'Events',
'Progress',
'Lenny is very special and thinks the UK needs a role',
'Roly Poly Cult',
];

View file

@ -82,6 +82,7 @@ client.once('ready', async () => {
if (e.cleanContent.match(BuildConfig.ETA_REGEX)) { if (e.cleanContent.match(BuildConfig.ETA_REGEX)) {
await e.reply( await e.reply(
/* CHANGEME */
`${random(BuildConfig.ETA_MESSAGES)} <:pofat:964546613194420294>` `${random(BuildConfig.ETA_MESSAGES)} <:pofat:964546613194420294>`
); );
} }
@ -111,6 +112,7 @@ client.on('interactionCreate', async (interaction) => {
await modrinthCommand(interaction); await modrinthCommand(interaction);
} else if (commandName === 'rolypoly') { } else if (commandName === 'rolypoly') {
await interaction.reply( await interaction.reply(
/* CHANGEME */
'https://media.discordapp.net/attachments/985048903126769764/985051373886382100/rollin-time.gif?width=324&height=216' 'https://media.discordapp.net/attachments/985048903126769764/985051373886382100/rollin-time.gif?width=324&height=216'
); );
} else if (commandName === 'say') { } else if (commandName === 'say') {

View file

@ -12,6 +12,7 @@ interface SimplifiedGHReleases {
// TODO: caching // TODO: caching
export async function getLatestMinecraftVersion(): Promise<string> { export async function getLatestMinecraftVersion(): Promise<string> {
const f = await fetch( const f = await fetch(
/* CHANGEME */
'https://meta.polymc.org/v1/net.minecraft/package.json' 'https://meta.polymc.org/v1/net.minecraft/package.json'
); );
@ -21,6 +22,7 @@ export async function getLatestMinecraftVersion(): Promise<string> {
// TODO: caching // TODO: caching
export async function getLatestPolyMCVersion(): Promise<string> { export async function getLatestPolyMCVersion(): Promise<string> {
/* CHANGEME */
const f = await fetch('https://api.github.com/repos/PolyMC/PolyMC/releases'); const f = await fetch('https://api.github.com/repos/PolyMC/PolyMC/releases');
const versions = (await f.json()) as SimplifiedGHReleases[]; const versions = (await f.json()) as SimplifiedGHReleases[];