mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
feat: removed inDevelopment
This commit is contained in:
1 parent
28172f7f8f
commit
eb4cb1fbfe
21 files changed
+5
-30
No files matched your search
@@ -12,7 +12,6 @@ const executionStart = new Date().getTime();
|
|||||||
|
|
||||||
export const debugCommand: CommandRegistry = {
|
export const debugCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ export const SKILLED_CLANS: Record<SkilledClan, string> = {
|
|||||||
|
|
||||||
export const eligibleCommand: CommandRegistry = {
|
export const eligibleCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
inPublic: false,
|
inPublic: false,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ export const evolutionCommand = new Promise<CommandRegistryRaw>(
|
|||||||
|
|
||||||
resolve({
|
resolve({
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command,
|
command,
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ export const fullStatsCommand = new Promise<CommandRegistryRaw>(
|
|||||||
|
|
||||||
resolve({
|
resolve({
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command,
|
command,
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ function addDocsSubcommands(option: SlashCommandSubcommandsOnlyBuilder) {
|
|||||||
|
|
||||||
export const helpCommand: CommandRegistry = {
|
export const helpCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: addDocsSubcommands(
|
command: addDocsSubcommands(
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ const DEFAULT_THRESHOLD = 7;
|
|||||||
|
|
||||||
export const inactiveCommand: CommandRegistry = {
|
export const inactiveCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ const COMP_TANKS = [
|
|||||||
|
|
||||||
export const ownedTanksCommand: CommandRegistry = {
|
export const ownedTanksCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { CommandRegistry } from '../events/interactionCreate';
|
|||||||
|
|
||||||
export const pingCommand: CommandRegistry = {
|
export const pingCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
handlesInteraction: true,
|
handlesInteraction: true,
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ type SortBy = 'name' | 'count';
|
|||||||
|
|
||||||
export const playerAchievementsCommand: CommandRegistry = {
|
export const playerAchievementsCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import { AccountInfo } from '../types/accountInfo';
|
|||||||
|
|
||||||
export const playerInfoCommand: CommandRegistry = {
|
export const playerInfoCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -162,7 +162,6 @@ export const ratingsCommand = new Promise<CommandRegistryRaw>(
|
|||||||
|
|
||||||
resolve({
|
resolve({
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command,
|
command,
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import { ClanList } from '../types/clanList';
|
|||||||
|
|
||||||
export const searchClansCommand: CommandRegistry = {
|
export const searchClansCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import { AccountList } from '../types/accountList';
|
|||||||
|
|
||||||
export const searchPlayersCommand: CommandRegistry = {
|
export const searchPlayersCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import { CommandRegistry } from '../events/interactionCreate';
|
|||||||
|
|
||||||
export const searchTanksCommand: CommandRegistry = {
|
export const searchTanksCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ export const statsCommand = new Promise<CommandRegistryRaw>(async (resolve) => {
|
|||||||
|
|
||||||
resolve({
|
resolve({
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command,
|
command,
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import { AccountInfo } from '../types/accountInfo';
|
|||||||
|
|
||||||
export const todayCommand: CommandRegistry = {
|
export const todayCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import { PlayerClanData } from '../types/playerClanData';
|
|||||||
|
|
||||||
export const verifyCommand: CommandRegistry = {
|
export const verifyCommand: CommandRegistry = {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ export type InteractionReturnable =
|
|||||||
| Promise<InteractionIterableReturnable>;
|
| Promise<InteractionIterableReturnable>;
|
||||||
|
|
||||||
export interface Registry {
|
export interface Registry {
|
||||||
inDevelopment: boolean;
|
|
||||||
inProduction: boolean;
|
inProduction: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,14 +121,12 @@ export const publicCommands: RESTPostAPIChatInputApplicationCommandsJSONBody[] =
|
|||||||
|
|
||||||
commands.then((awaitedCommands) => {
|
commands.then((awaitedCommands) => {
|
||||||
Object.entries(awaitedCommands).forEach(([, registry]) => {
|
Object.entries(awaitedCommands).forEach(([, registry]) => {
|
||||||
if (isDev() ? registry.inDevelopment : registry.inProduction) {
|
const json = registry.command.toJSON();
|
||||||
const json = registry.command.toJSON();
|
|
||||||
|
|
||||||
if (registry.inPublic) {
|
if (registry.inPublic) {
|
||||||
publicCommands.push(json);
|
publicCommands.push(json);
|
||||||
} else {
|
} else {
|
||||||
guildCommands.push(json);
|
guildCommands.push(json);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import { RouteRegistry } from '../server';
|
|||||||
export const statsRoute: RouteRegistry = {
|
export const statsRoute: RouteRegistry = {
|
||||||
route: '/stats/:type/:period',
|
route: '/stats/:type/:period',
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
|
|
||||||
async handler(req) {
|
async handler(req) {
|
||||||
const type = req.params.type as StatType;
|
const type = req.params.type as StatType;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { RouteRegistry } from '../server';
|
|||||||
export const todayRoute: RouteRegistry = {
|
export const todayRoute: RouteRegistry = {
|
||||||
route: '/today',
|
route: '/today',
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
|
||||||
|
|
||||||
async handler(req) {
|
async handler(req) {
|
||||||
const player = resolvePlayerFromRequest(req);
|
const player = resolvePlayerFromRequest(req);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import express, { Request, Response } from 'express';
|
import express, { Request, Response } from 'express';
|
||||||
import normalizeRouteReturnable from './core/express/normalizeRouteReturnable';
|
import normalizeRouteReturnable from './core/express/normalizeRouteReturnable';
|
||||||
import withAutoRefresh from './core/express/withAutoRefresh';
|
import withAutoRefresh from './core/express/withAutoRefresh';
|
||||||
import isDev from './core/node/isDev';
|
|
||||||
import { Registry } from './events/interactionCreate';
|
import { Registry } from './events/interactionCreate';
|
||||||
import { statsRoute } from './routes/stats';
|
import { statsRoute } from './routes/stats';
|
||||||
import { todayRoute } from './routes/today';
|
import { todayRoute } from './routes/today';
|
||||||
@@ -22,8 +21,6 @@ export interface RouteRegistry<HandlesInteraction extends boolean = false>
|
|||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
([statsRoute, todayRoute] as RouteRegistry[]).forEach((registry) => {
|
([statsRoute, todayRoute] as RouteRegistry[]).forEach((registry) => {
|
||||||
if (!(isDev() ? registry.inDevelopment : registry.inProduction)) return;
|
|
||||||
|
|
||||||
app.get(registry.route, async (req, res) => {
|
app.get(registry.route, async (req, res) => {
|
||||||
console.log(req.originalUrl);
|
console.log(req.originalUrl);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user