readd dm channel fix
This commit is contained in:
parent
53181ee4ac
commit
23ac2e3838
1 changed files with 12 additions and 0 deletions
12
src/index.js
12
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) => {
|
||||
|
|
Loading…
Reference in a new issue