2021-04-04 05:42:15 +00:00
|
|
|
import { Client } from '../client/mod.ts'
|
2020-10-31 12:33:34 +00:00
|
|
|
import { DMChannelPayload } from '../types/channel.ts'
|
|
|
|
import { UserPayload } from '../types/user.ts'
|
2020-10-23 16:11:00 +00:00
|
|
|
import { TextChannel } from './textChannel.ts'
|
2020-10-22 15:50:47 +00:00
|
|
|
|
2020-10-23 16:11:00 +00:00
|
|
|
export class DMChannel extends TextChannel {
|
|
|
|
recipients: UserPayload[]
|
|
|
|
|
2020-12-02 12:29:52 +00:00
|
|
|
constructor(client: Client, data: DMChannelPayload) {
|
2020-10-22 15:50:47 +00:00
|
|
|
super(client, data)
|
2020-10-23 16:11:00 +00:00
|
|
|
this.recipients = data.recipients
|
2020-10-29 14:43:27 +00:00
|
|
|
}
|
|
|
|
|
2020-12-03 05:28:20 +00:00
|
|
|
readFromData(data: DMChannelPayload): void {
|
2020-10-29 14:43:27 +00:00
|
|
|
super.readFromData(data)
|
|
|
|
this.recipients = data.recipients ?? this.recipients
|
2020-10-22 15:50:47 +00:00
|
|
|
}
|
|
|
|
}
|