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
|
|
|
|
|
2020-12-02 12:29:52 +00:00
|
|
|
constructor(client: Client, data: GroupDMChannelPayload) {
|
2020-10-23 16:11:00 +00:00
|
|
|
super(client, data)
|
|
|
|
|
|
|
|
this.name = data.name
|
|
|
|
this.icon = data.icon
|
|
|
|
this.ownerID = data.owner_id
|
2020-10-29 14:43:27 +00:00
|
|
|
}
|
|
|
|
|
2020-12-03 05:28:20 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|