GroupUp/src/commandUtils.ts

31 lines
908 B
TypeScript
Raw Normal View History

2023-01-11 18:21:43 -08:00
import { ApplicationCommandFlags } from '../deps.ts';
2023-01-11 15:06:20 -08:00
import config from '../config.ts';
2023-01-11 18:21:43 -08:00
import { lfgChannels } from './db.ts';
2023-01-11 15:06:20 -08:00
export const failColor = 0xe71212;
export const warnColor = 0xe38f28;
export const successColor = 0x0f8108;
export const infoColor1 = 0x313bf9;
export const infoColor2 = 0x6805e9;
export const getRandomStatus = (guildCount: number): string => {
2023-01-11 18:21:43 -08:00
const statuses = [
`Running V${config.version}`,
`${config.prefix}info to learn more`,
`Running LFGs in ${guildCount} servers`,
];
return statuses[Math.floor((Math.random() * statuses.length) + 1)];
};
2023-01-11 15:06:20 -08:00
2023-01-11 18:21:43 -08:00
export const isLFGChannel = (channelId: bigint) => {
return (lfgChannels.includes(channelId) || channelId === 0n) ? ApplicationCommandFlags.Ephemeral : undefined;
2023-01-11 15:06:20 -08:00
};
2023-01-11 19:23:27 -08:00
export const generateReport = (msg: string) => ({
embeds: [{
color: infoColor2,
title: 'USER REPORT:',
description: msg || 'No message',
}],
});