feat: preview servers

This commit is contained in:
TrèsAbhi committed 2024-03-16 15:07:05 -05:00
1 parent ec93d8e9ab
commit 04cd205fee
4 files changed
+19 -1

No files matched your search

@@ -15,6 +15,11 @@ import { psa } from '../../../core/discord/psa';
import { translator } from '../../../core/localization/translator';
import { UserError } from '../../../hooks/userError';
const previewServers = [
'734786591205359697', // abhi
'460165161156870161', // optml
];
export default async function handleChatInputCommand(
interaction: ChatInputCommandInteraction<CacheType>,
) {
@@ -24,6 +29,16 @@ export default async function handleChatInputCommand(
await interaction.deferReply();
try {
if (
registry.inPreview &&
!previewServers.includes(`${interaction.guildId}`)
) {
const { t } = translator(interaction.locale);
interaction.editReply(t`bot.common.errors.preview`);
return;
}
const returnable = await registry.handler(interaction);
if (registry.handlesInteraction) return;
+1
View File
@@ -55,6 +55,7 @@ export type InteractionReturnable =
interface CommandRegistryBase {
inProduction: boolean;
inPublic: boolean;
inPreview?: boolean;
command:
| SlashCommandBuilder