2020-10-30 14:51:40 +00:00
|
|
|
import { Gateway, GatewayEventHandler } from '../index.ts'
|
|
|
|
import getChannelByType from '../../utils/getChannelByType.ts'
|
|
|
|
|
|
|
|
export const channelCreate: GatewayEventHandler = (
|
|
|
|
gateway: Gateway,
|
|
|
|
d: any
|
|
|
|
) => {
|
|
|
|
const channel = getChannelByType(gateway.client, d)
|
|
|
|
|
|
|
|
if (channel !== undefined) {
|
2020-10-31 11:45:33 +00:00
|
|
|
gateway.client.channels.set(d.id, d)
|
2020-10-30 14:51:40 +00:00
|
|
|
gateway.client.emit('channelCreate', channel)
|
|
|
|
}
|
|
|
|
}
|