mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +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
@@ -31,6 +31,7 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
resolve({
|
resolve({
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
inPreview: true,
|
||||||
|
|
||||||
command: createLocalizedCommand('research')
|
command: createLocalizedCommand('research')
|
||||||
.addStringOption((option) =>
|
.addStringOption((option) =>
|
||||||
|
|||||||
@@ -15,6 +15,11 @@ import { psa } from '../../../core/discord/psa';
|
|||||||
import { translator } from '../../../core/localization/translator';
|
import { translator } from '../../../core/localization/translator';
|
||||||
import { UserError } from '../../../hooks/userError';
|
import { UserError } from '../../../hooks/userError';
|
||||||
|
|
||||||
|
const previewServers = [
|
||||||
|
'734786591205359697', // abhi
|
||||||
|
'460165161156870161', // optml
|
||||||
|
];
|
||||||
|
|
||||||
export default async function handleChatInputCommand(
|
export default async function handleChatInputCommand(
|
||||||
interaction: ChatInputCommandInteraction<CacheType>,
|
interaction: ChatInputCommandInteraction<CacheType>,
|
||||||
) {
|
) {
|
||||||
@@ -24,6 +29,16 @@ export default async function handleChatInputCommand(
|
|||||||
await interaction.deferReply();
|
await interaction.deferReply();
|
||||||
|
|
||||||
try {
|
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);
|
const returnable = await registry.handler(interaction);
|
||||||
|
|
||||||
if (registry.handlesInteraction) return;
|
if (registry.handlesInteraction) return;
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ export type InteractionReturnable =
|
|||||||
interface CommandRegistryBase {
|
interface CommandRegistryBase {
|
||||||
inProduction: boolean;
|
inProduction: boolean;
|
||||||
inPublic: boolean;
|
inPublic: boolean;
|
||||||
|
inPreview?: boolean;
|
||||||
|
|
||||||
command:
|
command:
|
||||||
| SlashCommandBuilder
|
| SlashCommandBuilder
|
||||||
|
|||||||
+2
-1
@@ -190,7 +190,8 @@
|
|||||||
"tank_id_not_found": "# Tank not found\nCould not find tank by the ID \"%s\". Try typing the name of the tank instead of a number.",
|
"tank_id_not_found": "# Tank not found\nCould not find tank by the ID \"%s\". Try typing the name of the tank instead of a number.",
|
||||||
"no_tank_stats": "# No tank stats available\nThis player doesn't have any stats available. This may not be the player you are looking for.",
|
"no_tank_stats": "# No tank stats available\nThis player doesn't have any stats available. This may not be the player you are looking for.",
|
||||||
"get_help": "Help Discord server",
|
"get_help": "Help Discord server",
|
||||||
"uncaught_error": "# Blitzkrieg ran into an error!\nWe're so sorry about this. Feel free to [join the official Discord server](https://discord.gg/nDt7AjGJQH) to get help."
|
"uncaught_error": "# Blitzkrieg ran into an error!\nWe're so sorry about this. Feel free to [join the official Discord server](https://discord.gg/nDt7AjGJQH) to get help.",
|
||||||
|
"preview": "# This command is in preview\n\nYou can only access this command in [the official Discord server](https://discord.gg/nDt7AjGJQH). The command will be generally available soon."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user