diff --git a/src/index.js b/src/index.js index 39957a2..dd48d8c 100644 --- a/src/index.js +++ b/src/index.js @@ -54,6 +54,18 @@ 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 Dysnomia.Channel) && + msg.author.id != bot.user.id && + !msg.guildID + ) { + const newChannel = await bot.getDMChannel(msg.author.id); + if (msg.channel.id == newChannel.id) msg.channel = newChannel; + } + + if (!(msg.channel instanceof Dysnomia.Channel)) return; + await CommandDispatcher(msg); }); bot.on("messageUpdate", (msg, oldMsg) => {