File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ module.exports = {
5959const { Events , GatewayIntentBits } = require (" discord.js" );
6060// Name it whatever you want
6161const Client = require (" djs-command-deployer" );
62+ const { join: pathJoin } = require (" node:path" );
6263
6364const { token } = require (" ./config.json" );
6465
@@ -74,7 +75,10 @@ client.once(Events.ClientReady, (readyClient) => {
7475 console .log (` Ready! Logged in as ${ readyClient .user .tag } ` );
7576
7677 // Call the CommandDeployer to refresh your commands
77- client .deployCommands (" commands/utility" ); // Optional: logOptions object
78+ readyClient .deployCommands (
79+ pathJoin (__dirname , " commands" , " utility" )
80+ // Optional: logOptions object
81+ );
7882});
7983
8084// Log in to Discord with your client's token
Original file line number Diff line number Diff line change @@ -22,12 +22,12 @@ module.exports = class cDClient extends Client {
2222 * To update guild-specific commands correctly, make sure the bot is logged in.\
2323 * Otherwise the check for a guild ID is omitted, and you could make pointless requests which can also result in an error
2424 *
25- * @param {string } folderPath The relative path to your commands folder (the command files have to be directly in it!)
25+ * @param {string } folderPath The absolute path to your commands folder (the command files have to be directly in it!)
2626 * @param {string } token The bot's token (if the client isn't logged in yet)
2727 * @param {DEFAULT_OPTS } logOptions Whether to log what command was ignored, created, updated or deleted
2828 */
2929 async deployCommands (
30- folderPath = "./commands/utility" ,
30+ folderPath ,
3131 token = null ,
3232 logOptions = DEFAULT_OPTS
3333 ) {
Original file line number Diff line number Diff line change 11{
22 "name" : " djs-command-deployer" ,
3- "version" : " 0.5.3 " ,
3+ "version" : " 0.5.4 " ,
44 "description" : " " ,
55 "main" : " ./index.js" ,
66 "scripts" : {},
You can’t perform that action at this time.
0 commit comments