diff --git a/.env.sample b/.env.sample index c40eeaa..bf3df0f 100644 --- a/.env.sample +++ b/.env.sample @@ -2,9 +2,6 @@ BOT_TOKEN = #used for adding bot/application to server CLIENT_ID = -# invite link: -# https://discord.com/api/oauth2/authorize?CLIENT_ID=&permissions=0&scope=bot%20applications.commands -SERVER_ID = # Mongo configuration MONGO_URI= MONGO_PORT= diff --git a/src/deployment/deploy.service.ts b/src/deployment/deploy.service.ts index c3775e1..9988b22 100644 --- a/src/deployment/deploy.service.ts +++ b/src/deployment/deploy.service.ts @@ -1,4 +1,8 @@ -import { REST, RESTPostAPIChatInputApplicationCommandsJSONBody, Routes } from 'discord.js'; +import { + REST, + RESTPostAPIChatInputApplicationCommandsJSONBody, + Routes, +} from 'discord.js'; import { Injectable } from '@nestjs/common'; import { CommandService } from '../modules/command/command.service'; import { AppConfigService } from '../config/config.service'; @@ -18,18 +22,25 @@ export class DeployServcice { return commands.map((command) => command.data.toJSON()); } - async deployCommands(commands: RESTPostAPIChatInputApplicationCommandsJSONBody[]) { + async deployCommands( + commands: RESTPostAPIChatInputApplicationCommandsJSONBody[], + ) { // Construct and prepare an instance of the REST module const rest = new REST().setToken(this.configService.botToken); // and deploy your commands! try { - console.log(`Started refreshing ${commands.length} application (/) commands.`); + console.log( + `Started refreshing ${commands.length} application (/) commands.`, + ); // The put method is used to fully refresh all commands in the guild with the current set - const data = await rest.put(Routes.applicationGuildCommands(process.env.CLIENT_ID ?? '', process.env.SERVER_ID ?? ''), { - body: commands, - }); + const data = await rest.put( + Routes.applicationCommands(process.env.CLIENT_ID ?? ''), + { + body: commands, + }, + ); let log = ''; if (Array.isArray(data)) log = data.length + ' ';