mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 03:07:04 +02:00
feat: preview servers
This commit is contained in:
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;
|
||||
|
||||
@@ -55,6 +55,7 @@ export type InteractionReturnable =
|
||||
interface CommandRegistryBase {
|
||||
inProduction: boolean;
|
||||
inPublic: boolean;
|
||||
inPreview?: boolean;
|
||||
|
||||
command:
|
||||
| SlashCommandBuilder
|
||||
|
||||
Reference in new issue
Block a user