harmony/src/gateway/handlers/voiceServerUpdate.ts

15 lines
485 B
TypeScript
Raw Normal View History

2021-04-04 09:29:56 +00:00
import type { Guild } from '../../structures/guild.ts'
import type { VoiceServerUpdatePayload } from '../../types/gateway.ts'
2021-04-04 05:42:15 +00:00
import type { Gateway, GatewayEventHandler } from '../mod.ts'
2020-12-02 12:29:52 +00:00
export const voiceServerUpdate: GatewayEventHandler = async (
gateway: Gateway,
d: VoiceServerUpdatePayload
) => {
gateway.client.emit('voiceServerUpdate', {
token: d.token,
endpoint: d.endpoint,
guild: ((await gateway.client.guilds.get(d.guild_id)) as unknown) as Guild
})
}