properly support guild update events
This commit is contained in:
parent
5e6bb0cd2e
commit
d3f637d7ce
1 changed files with 9 additions and 0 deletions
|
@ -43,6 +43,15 @@ const utils = {
|
||||||
}
|
}
|
||||||
eventDispatcher.checkMissedMessages(client, message.d)
|
eventDispatcher.checkMissedMessages(client, message.d)
|
||||||
|
|
||||||
|
} else if (message.t === "GUILD_UPDATE") {
|
||||||
|
const guild = client.guilds.get(message.d.id)
|
||||||
|
if (guild) {
|
||||||
|
for (const prop of Object.keys(message.d)) {
|
||||||
|
if (!["channels", "threads"].includes(prop)) {
|
||||||
|
guild[prop] = message.d[prop]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else if (message.t === "THREAD_CREATE") {
|
} else if (message.t === "THREAD_CREATE") {
|
||||||
client.channels.set(message.d.id, message.d)
|
client.channels.set(message.d.id, message.d)
|
||||||
|
|
Loading…
Reference in a new issue