fix the major discord command issue

This commit is contained in:
ChomeNS 2023-03-16 09:23:18 +07:00
parent 8cb60ec77e
commit b4cafe0bec

View file

@ -3,7 +3,7 @@ const path = require('path')
const { EmbedBuilder } = require('discord.js') const { EmbedBuilder } = require('discord.js')
function inject (bot, dcclient, config) { function inject (bot, dcclient, config) {
const loadFiles = require('../util/load_files') const loadFiles = require('../util/load_files')
const channeldc = dcclient.channels.cache.get(config.discord.servers[bot.server.host]) const channeldc = dcclient.channels.cache.get(config.discord.servers[`${bot.server.host}:${bot.server.port}`])
bot.command_handler = {} bot.command_handler = {}
bot.command_handler.commands = {} bot.command_handler.commands = {}
bot.command_handler.reload = async function () { bot.command_handler.reload = async function () {
@ -111,7 +111,7 @@ function inject (bot, dcclient, config) {
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, 'no sender for discord', channeldc) bot.command_handler.main(config.discord.prefix, message.member.displayName, message, 'no sender for discord', channeldc)
} catch (e) { } catch (e) {
return bot.console.error(e.stack)
}; };
} }
bot.on('end', () => { bot.on('end', () => {