2020-12-02 12:29:52 +00:00
|
|
|
import { Gateway, GatewayEventHandler } from '../index.ts'
|
|
|
|
import { ChannelPayload } from '../../types/channel.ts'
|
|
|
|
|
|
|
|
export const channelDelete: GatewayEventHandler = async (
|
|
|
|
gateway: Gateway,
|
|
|
|
d: ChannelPayload
|
|
|
|
) => {
|
|
|
|
const channel = await gateway.client.channels.get(d.id)
|
|
|
|
if (channel !== undefined) {
|
2020-12-31 04:49:58 +00:00
|
|
|
await gateway.client.channels._delete(d.id)
|
2020-12-02 12:29:52 +00:00
|
|
|
gateway.client.emit('channelDelete', channel)
|
|
|
|
}
|
|
|
|
}
|