-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Removed - reload-cmd command - Removed - reload-event command - Added - reload command - Added - Reload all commands function - Added - Reload all events function
- Loading branch information
1 parent
5f1d1f9
commit ccd9d9c
Showing
6 changed files
with
99 additions
and
57 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
'use strict'; | ||
|
||
const Command = require("../../structure/Command.js"); | ||
|
||
class ReloadCommand extends Command { | ||
constructor() { | ||
super({ | ||
name: 'reload', | ||
category: 'owner', | ||
description: 'reload files', | ||
usage: 'reload <-all/-c/-e> <file-name-without-.js/-c/-all/-e>', | ||
example: ['reload -c help','reload -c ping','reload -e message', 'reload -e ready', 'reload -all -c','reload -all -e','reload -all -all'], | ||
perms: "owner", | ||
aliases: ['rl'] | ||
}); | ||
} | ||
|
||
async run(client, message, args) { | ||
if(!args[1]) { | ||
message.channel.send("> No type specified!"); | ||
} else if(args[1] === '-all') { | ||
if(!args[2]) { | ||
client.reloadAllCommands().then(res_c => { | ||
client.reloadAllEvents().then(res_e => { | ||
message.channel.send(`${res_c}\n${res_e}`) | ||
}) | ||
}) | ||
} else if(args[2] === "-c") { | ||
client.reloadAllCommands().then(res => { | ||
message.channel.send(res) | ||
}) | ||
} else if(args[2] === "-e") { | ||
client.reloadAllEvents().then(res => { | ||
message.channel.send(res) | ||
}) | ||
} | ||
} else if(!args[2]) { | ||
message.channel.send("> No file specified!"); | ||
} else { | ||
if(args[1] === '-c') { | ||
client.reloadCommand(args[2]).then(async res => { | ||
await message.channel.send(res); | ||
}); | ||
} else if(args[1] === '-e') { | ||
client.reloadEvent(args[2]).then(async res => { | ||
await message.channel.send(res); | ||
}); | ||
} | ||
|
||
} | ||
} | ||
} | ||
|
||
module.exports = new ReloadCommand; |
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
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