harmony/src/structures/groupChannel.ts

25 lines
628 B
TypeScript
Raw Normal View History

2021-04-04 05:42:15 +00:00
import { Client } from '../client/mod.ts'
2020-10-31 12:33:34 +00:00
import { GroupDMChannelPayload } from '../types/channel.ts'
import { Channel } from './channel.ts'
export class GroupDMChannel extends Channel {
name: string
icon?: string
ownerID: string
2020-12-02 12:29:52 +00:00
constructor(client: Client, data: GroupDMChannelPayload) {
super(client, data)
this.name = data.name
this.icon = data.icon
this.ownerID = data.owner_id
}
2020-12-03 05:28:20 +00:00
readFromData(data: GroupDMChannelPayload): void {
super.readFromData(data)
this.name = data.name ?? this.name
this.icon = data.icon ?? this.icon
this.ownerID = data.owner_id ?? this.ownerID
}
}