forked from TFAGaming/DiscordJS-V14-Bot-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use info level on the load command instead of warning
- Loading branch information
1 parent
6ec5560
commit 5be8bac
Showing
1 changed file
with
22 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,32 @@ | ||
const { REST, Routes } = require("discord.js"); | ||
const { log } = require("../functions"); | ||
const config = require("../config"); | ||
const ExtendedClient = require('../class/ExtendedClient'); | ||
const ExtendedClient = require("../class/ExtendedClient"); | ||
|
||
/** | ||
* | ||
* @param {ExtendedClient} client | ||
* | ||
* @param {ExtendedClient} client | ||
*/ | ||
module.exports = async (client) => { | ||
const rest = new REST({ version: '10' }).setToken(process.env.CLIENT_TOKEN || config.client.token); | ||
const rest = new REST({ version: "10" }).setToken( | ||
process.env.CLIENT_TOKEN || config.client.token | ||
); | ||
|
||
try { | ||
log('Started loading application commands... (this might take minutes!)', 'warn'); | ||
try { | ||
log( | ||
"Started loading application commands... (this might take minutes!)", | ||
"info" | ||
); | ||
|
||
await rest.put(Routes.applicationCommands(process.env.CLIENT_ID || config.client.id), { | ||
body: client.applicationcommandsArray | ||
}); | ||
await rest.put( | ||
Routes.applicationCommands(process.env.CLIENT_ID || config.client.id), | ||
{ | ||
body: client.applicationcommandsArray, | ||
} | ||
); | ||
|
||
log('Successfully loaded application commands to Discord API.', 'done'); | ||
} catch (e) { | ||
log('Unable to load application commands to Discord API.', 'err'); | ||
}; | ||
}; | ||
log("Successfully loaded application commands to Discord API.", "done"); | ||
} catch (e) { | ||
log("Unable to load application commands to Discord API.", "err"); | ||
} | ||
}; |