refactor(all): uniformisation
This commit is contained in:
89 files changed
+10215
-10215
No files matched your search
+13
-13
@@ -1,13 +1,13 @@
|
||||
import { REST, Routes } from 'discord.js';
|
||||
import { assertRequiredEnv, env } from '../src/config/env.js';
|
||||
import { loadCommands } from '../src/core/command-loader.js';
|
||||
|
||||
assertRequiredEnv(['DISCORD_TOKEN', 'DISCORD_CLIENT_ID', 'DISCORD_GUILD_ID']);
|
||||
|
||||
const body = (await loadCommands()).map((command) => command.data.toJSON());
|
||||
const rest = new REST().setToken(env.discord.token);
|
||||
|
||||
// Guild commands update instantly, which suits a single-server bot (M2-T05).
|
||||
await rest.put(Routes.applicationGuildCommands(env.discord.clientId, env.discord.guildId), { body });
|
||||
|
||||
console.log(`Registered ${body.length} slash commands on guild ${env.discord.guildId}.`);
|
||||
import { REST, Routes } from 'discord.js';
|
||||
import { assertRequiredEnv, env } from '../src/config/env.js';
|
||||
import { loadCommands } from '../src/core/command-loader.js';
|
||||
|
||||
assertRequiredEnv(['DISCORD_TOKEN', 'DISCORD_CLIENT_ID', 'DISCORD_GUILD_ID']);
|
||||
|
||||
const body = (await loadCommands()).map((command) => command.data.toJSON());
|
||||
const rest = new REST().setToken(env.discord.token);
|
||||
|
||||
// Guild commands update instantly, which suits a single-server bot (M2-T05).
|
||||
await rest.put(Routes.applicationGuildCommands(env.discord.clientId, env.discord.guildId), { body });
|
||||
|
||||
console.log(`Registered ${body.length} slash commands on guild ${env.discord.guildId}.`);
|
||||
Reference in new issue
Block a user