quick fix - use _delete for cache delete
This commit is contained in:
parent
2ddb6bf5a5
commit
417854b1bb
5 changed files with 5 additions and 5 deletions
|
@ -7,7 +7,7 @@ export const channelDelete: GatewayEventHandler = async (
|
||||||
) => {
|
) => {
|
||||||
const channel = await gateway.client.channels.get(d.id)
|
const channel = await gateway.client.channels.get(d.id)
|
||||||
if (channel !== undefined) {
|
if (channel !== undefined) {
|
||||||
await gateway.client.channels.delete(d.id)
|
await gateway.client.channels._delete(d.id)
|
||||||
gateway.client.emit('channelDelete', channel)
|
gateway.client.emit('channelDelete', channel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ export const guildDelete: GatewayEventHandler = async (
|
||||||
await guild.channels.flush()
|
await guild.channels.flush()
|
||||||
await guild.roles.flush()
|
await guild.roles.flush()
|
||||||
await guild.presences.flush()
|
await guild.presences.flush()
|
||||||
await gateway.client.guilds.delete(d.id)
|
await gateway.client.guilds._delete(d.id)
|
||||||
|
|
||||||
gateway.client.emit('guildDelete', guild)
|
gateway.client.emit('guildDelete', guild)
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ export const guildRoleDelete: GatewayEventHandler = async (
|
||||||
const role = await guild.roles.get(d.role_id)
|
const role = await guild.roles.get(d.role_id)
|
||||||
// Shouldn't happen either
|
// Shouldn't happen either
|
||||||
if (role === undefined) return
|
if (role === undefined) return
|
||||||
|
await guild.roles._delete(d.role_id)
|
||||||
|
|
||||||
gateway.client.emit('guildRoleDelete', role)
|
gateway.client.emit('guildRoleDelete', role)
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@ export const inviteDelete: GatewayEventHandler = async (
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||||
const cachedGuild = await gateway.client.guilds.get(d.guild_id!)
|
const cachedGuild = await gateway.client.guilds.get(d.guild_id!)
|
||||||
|
|
||||||
// TODO(DjDeveloperr): Make it support self-bots and make Guild not always defined
|
|
||||||
if (cachedInvite === undefined) {
|
if (cachedInvite === undefined) {
|
||||||
const uncachedInvite: PartialInvitePayload = {
|
const uncachedInvite: PartialInvitePayload = {
|
||||||
guild: (cachedGuild as unknown) as Guild,
|
guild: (cachedGuild as unknown) as Guild,
|
||||||
|
@ -28,7 +27,7 @@ export const inviteDelete: GatewayEventHandler = async (
|
||||||
}
|
}
|
||||||
return gateway.client.emit('inviteDeleteUncached', uncachedInvite)
|
return gateway.client.emit('inviteDeleteUncached', uncachedInvite)
|
||||||
} else {
|
} else {
|
||||||
await guild.invites.delete(d.code)
|
await guild.invites._delete(d.code)
|
||||||
gateway.client.emit('inviteDelete', cachedInvite)
|
gateway.client.emit('inviteDelete', cachedInvite)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,6 @@ export const messageDelete: GatewayEventHandler = async (
|
||||||
const message = await channel.messages.get(d.id)
|
const message = await channel.messages.get(d.id)
|
||||||
if (message === undefined)
|
if (message === undefined)
|
||||||
return gateway.client.emit('messageDeleteUncached', d)
|
return gateway.client.emit('messageDeleteUncached', d)
|
||||||
await channel.messages.delete(d.id)
|
await channel.messages._delete(d.id)
|
||||||
gateway.client.emit('messageDelete', message)
|
gateway.client.emit('messageDelete', message)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue