mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 18:54: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 path = require('path');
|
||||||
const {MessageEmbed} = require('discord.js');
|
const {MessageEmbed} = require('discord.js');
|
||||||
function inject(bot, dcclient, config) {
|
function inject(bot, dcclient, config) {
|
||||||
|
const channeldc = dcclient.channels.cache.get(config.discord.servers[bot.options.host]);
|
||||||
bot.command_handler = {};
|
bot.command_handler = {};
|
||||||
bot.command_handler.commands = {};
|
bot.command_handler.commands = {};
|
||||||
function reload() {
|
function reload() {
|
||||||
|
@ -68,10 +69,8 @@ function inject(bot, dcclient, config) {
|
||||||
try {
|
try {
|
||||||
// ignores the message that comes from the bot itself
|
// ignores the message that comes from the bot itself
|
||||||
if (message.author.id === dcclient.user.id) return;
|
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
|
// 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;
|
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);
|
bot.command_handler.main(config.discord.prefix, message.member.displayName, message.member.displayName, message, 'no sender for discord', channeldc);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in a new issue