readd dm channel fix

This commit is contained in:
Cynthia Foxwell 2023-01-23 22:50:55 -07:00
parent 53181ee4ac
commit 23ac2e3838

View file

@ -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) => {