diff --git a/src/index.js b/src/index.js index f997bd8..4f87827 100644 --- a/src/index.js +++ b/src/index.js @@ -53,7 +53,12 @@ for (const file of fs.readdirSync(resolve(__dirname, "modules"))) { logger.info("hf:modules", "Loaded module: '%s'", file); } -bot.on("messageCreate", CommandDispatcher); +bot.on("messageCreate", async (msg) => { + if (!(msg.channel instanceof Eris.Channel) && msg.author.id != bot.user.id) { + msg.channel = await bot.getDMChannel(msg.author.id); + } + await CommandDispatcher(msg); +}); bot.on("messageUpdate", (msg) => { const oneDay = Date.now() - 86400000; if (msg.timestamp > oneDay && !msg.hasRan) {