feat: removed inDevelopment

This commit is contained in:
TresAbhi committed 2023-08-24 00:08:08 +00:00
1 parent 28172f7f8f
commit eb4cb1fbfe
21 files changed
+5 -30

No files matched your search

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