mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-27 09:35:35 -05:00
discord support for end command
This commit is contained in:
parent
aec461f4f8
commit
89f8d5d94d
3 changed files with 12 additions and 2 deletions
|
@ -1,3 +1,5 @@
|
|||
/* eslint-disable max-len */
|
||||
const config = require('../config.json');
|
||||
module.exports = {
|
||||
name: 'end',
|
||||
alias: [],
|
||||
|
@ -11,4 +13,11 @@ module.exports = {
|
|||
throw new Error('Invalid hash');
|
||||
}
|
||||
},
|
||||
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {
|
||||
if (message.member._roles.at(0)===config.discord.trustedRoleID) {
|
||||
bot.emit('end', 'end command');
|
||||
} else {
|
||||
throw new Error('You\'re not in trusted role!');
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -17,7 +17,8 @@
|
|||
"192.168.1.103:25565": "1002806756885413978",
|
||||
"kitsune.icu:25565": "1004006678460637315"
|
||||
},
|
||||
"prefix": "!"
|
||||
"prefix": "!",
|
||||
"trustedRoleID": "981159334299983953"
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ function inject(bot, dcclient) {
|
|||
|
||||
if (prefix==='!') {
|
||||
if (typeof command.discordExecute==='undefined') throw new Error('This command is not yet supported on discord!');
|
||||
command.discordExecute(bot, username, usernameraw, sender, prefix, args, channeldc);
|
||||
command.discordExecute(bot, username, usernameraw, sender, prefix, args, channeldc, message);
|
||||
} else {
|
||||
command.execute(bot, username, usernameraw, sender, prefix, args);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue