2020-10-22 15:50:47 +00:00
|
|
|
import { Client } from '../models/client.ts'
|
2020-10-23 16:11:00 +00:00
|
|
|
import {
|
|
|
|
ChannelPayload,
|
|
|
|
GuildChannelCategoryPayload,
|
|
|
|
GuildNewsChannelPayload,
|
|
|
|
GuildTextChannelPayload,
|
|
|
|
GuildVoiceChannelPayload,
|
|
|
|
DMChannelPayload,
|
|
|
|
GroupDMChannelPayload,
|
|
|
|
ChannelTypes
|
|
|
|
} from '../types/channelTypes.ts'
|
2020-10-22 15:50:47 +00:00
|
|
|
import { Base } from './base.ts'
|
2020-10-24 12:11:54 +00:00
|
|
|
import { CategoryChannel } from './guildCategoryChannel.ts'
|
2020-10-23 16:11:00 +00:00
|
|
|
import { VoiceChannel } from './guildVoiceChannel.ts'
|
2020-10-24 12:11:54 +00:00
|
|
|
import { NewsChannel } from './guildnewsChannel.ts'
|
|
|
|
import { DMChannel } from './dmChannel.ts'
|
2020-10-24 15:00:42 +00:00
|
|
|
import { GroupDMChannel } from './groupChannel.ts'
|
2020-10-22 15:50:47 +00:00
|
|
|
import { TextChannel } from './textChannel.ts'
|
|
|
|
|
|
|
|
export class Channel extends Base {
|
|
|
|
type: ChannelTypes
|
|
|
|
id: string
|
2020-10-24 15:00:42 +00:00
|
|
|
static cacheName = 'channel'
|
|
|
|
static cacheArgIndex = 0
|
2020-10-22 15:50:47 +00:00
|
|
|
|
|
|
|
constructor (client: Client, data: ChannelPayload) {
|
2020-10-25 06:50:32 +00:00
|
|
|
super(client, data)
|
2020-10-22 15:50:47 +00:00
|
|
|
this.type = data.type
|
|
|
|
this.id = data.id
|
|
|
|
}
|
|
|
|
|
|
|
|
get mention () {
|
|
|
|
return `<#${this.id}>`
|
|
|
|
}
|
|
|
|
}
|