mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
discord cmd handler fixed guys!!
This commit is contained in:
parent
953ec94cb0
commit
69711aa978
1 changed files with 2 additions and 3 deletions
|
@ -3,6 +3,7 @@ const loadFiles = require('../util/load_files');
|
|||
const path = require('path');
|
||||
const {MessageEmbed} = require('discord.js');
|
||||
function inject(bot, dcclient, config) {
|
||||
const channeldc = dcclient.channels.cache.get(config.discord.servers[bot.options.host]);
|
||||
bot.command_handler = {};
|
||||
bot.command_handler.commands = {};
|
||||
function reload() {
|
||||
|
@ -68,10 +69,8 @@ function inject(bot, dcclient, config) {
|
|||
try {
|
||||
// ignores the message that comes from the bot itself
|
||||
if (message.author.id === dcclient.user.id) return;
|
||||
const channelid = message.channel.id;
|
||||
const channeldc = dcclient.channels.cache.get(channelid);
|
||||
// only receive messages in SPECIFIC channel
|
||||
if (message.channel.id != bot.channelId) return;
|
||||
if (message.channel.id !== channeldc.id) return;
|
||||
if (!message.content.startsWith(config.discord.prefix)) return;
|
||||
bot.command_handler.main(config.discord.prefix, message.member.displayName, message.member.displayName, message, 'no sender for discord', channeldc);
|
||||
} catch (e) {
|
||||
|
|
Loading…
Reference in a new issue