diff --git a/src/index.js b/src/index.js index 4f87827..8b9fcbd 100644 --- a/src/index.js +++ b/src/index.js @@ -54,9 +54,15 @@ for (const file of fs.readdirSync(resolve(__dirname, "modules"))) { } bot.on("messageCreate", async (msg) => { + // fix DMs cause of gateway v8 changes if (!(msg.channel instanceof Eris.Channel) && msg.author.id != bot.user.id) { - msg.channel = await bot.getDMChannel(msg.author.id); + const newChannel = await bot.getDMChannel(msg.author.id); + if (msg.channel.id == newChannel.id) msg.channel = newChannel; } + + // if we still have no dm channel (threads cause this too) + if (!(msg.channel instanceof Eris.Channel)) return; + await CommandDispatcher(msg); }); bot.on("messageUpdate", (msg) => {