harmony/src/gateway/handlers/channelDelete.ts

14 lines
422 B
TypeScript
Raw Normal View History

2021-04-04 05:42:15 +00:00
import type { Gateway, GatewayEventHandler } from '../mod.ts'
2021-04-04 09:29:56 +00:00
import type { ChannelPayload } from '../../types/channel.ts'
2020-12-02 12:29:52 +00:00
export const channelDelete: GatewayEventHandler = async (
gateway: Gateway,
d: ChannelPayload
) => {
const channel = await gateway.client.channels.get(d.id)
if (channel !== undefined) {
await gateway.client.channels._delete(d.id)
2020-12-02 12:29:52 +00:00
gateway.client.emit('channelDelete', channel)
}
}