mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
fixed
This commit is contained in:
parent
89f8d5d94d
commit
fb95cb30a5
1 changed files with 4 additions and 2 deletions
|
@ -7,7 +7,9 @@ const {MessageEmbed} = require('discord.js');
|
|||
function inject(bot, dcclient) {
|
||||
bot.command_handler.commands = loadFiles(path.join(__dirname, '../commands'));
|
||||
bot.command_handler.main = function(prefix, username, usernameraw, message, sender, channeldc) {
|
||||
const raw = message.substr(prefix.length);
|
||||
let raw;
|
||||
if (typeof message.content!=='undefined') raw = message.content.substr(prefix.length);
|
||||
if (typeof message.content==='undefined') raw = message.substr(prefix.length);
|
||||
const [commandName, ...args] = raw.split(' ');
|
||||
var command = bot.command_handler.commands.find((command) => command.name === commandName.toLowerCase());
|
||||
try {
|
||||
|
@ -69,7 +71,7 @@ function inject(bot, dcclient) {
|
|||
// only receive messages in SPECIFIC channel
|
||||
if (message.channel.id != bot.channelId) return;
|
||||
if (!message.content.startsWith(config.discord.prefix)) return;
|
||||
bot.command_handler.main(config.discord.prefix, message.member.displayName, message.member.displayName, message.content, 'no sender for discord', channeldc);
|
||||
bot.command_handler.main(config.discord.prefix, message.member.displayName, message.member.displayName, message, 'no sender for discord', channeldc);
|
||||
} catch (e) {
|
||||
return;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue