feat: added basic infrastructure for ratings command

This commit is contained in:
TresAbhi committed 2023-07-15 18:44:20 +00:00
1 parent 9419aec116
commit aa6011b18d
40 files changed
+227 -96

No files matched your search

@@ -6,6 +6,7 @@ import {
ChatInputCommandInteraction,
} from 'discord.js';
import { commands } from '..';
import discord from '../../../../discord.json' assert { type: 'json' };
import embedNegative from '../../../core/discord/embedNegative';
import embedWarning from '../../../core/discord/embedWarning';
import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable';
@@ -21,6 +22,19 @@ export default async function handleChatInputCommand(
await interaction.deferReply();
try {
if (registry.inPreview && interaction.guildId !== discord.tres_guild_id) {
interaction.editReply({
embeds: [
embedWarning(
`\`/${registry.command.name}\` is in Public Preview`,
'[Join the official Discord server](https://discord.gg/nDt7AjGJQH) to gain early access to this command before it is released to the public.',
),
],
});
return;
}
const returnable = await registry.handler(interaction);
if (registry.handlesInteraction) return;