2020-10-23 16:11:00 +00:00
|
|
|
import { Client } from '../models/client.ts'
|
2020-10-31 12:33:34 +00:00
|
|
|
import { GroupDMChannelPayload } from '../types/channel.ts'
|
2020-10-23 16:11:00 +00:00
|
|
|
import { Channel } from './channel.ts'
|
|
|
|
|
2020-10-25 17:03:53 +00:00
|
|
|
export class GroupDMChannel extends Channel {
|
2020-10-23 16:11:00 +00:00
|
|
|
name: string
|
|
|
|
icon?: string
|
|
|
|
ownerID: string
|
|
|
|
|
|
|
|
constructor (client: Client, data: GroupDMChannelPayload) {
|
|
|
|
super(client, data)
|
|
|
|
|
|
|
|
this.name = data.name
|
|
|
|
this.icon = data.icon
|
|
|
|
this.ownerID = data.owner_id
|
2020-11-01 11:22:09 +00:00
|
|
|
// TODO: Cache in Gateway Event Code
|
|
|
|
// cache.set('groupchannel', this.id, this)
|
2020-10-29 14:43:27 +00:00
|
|
|
}
|
|
|
|
|
2020-10-30 14:51:40 +00:00
|
|
|
protected readFromData (data: GroupDMChannelPayload): void {
|
2020-10-29 14:43:27 +00:00
|
|
|
super.readFromData(data)
|
|
|
|
this.name = data.name ?? this.name
|
|
|
|
this.icon = data.icon ?? this.icon
|
|
|
|
this.ownerID = data.owner_id ?? this.ownerID
|
2020-10-23 16:11:00 +00:00
|
|
|
}
|
|
|
|
}
|