PartialGroupDMChannel.js
989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
'use strict';
const Channel = require('./Channel');
const { Error } = require('../errors');
/**
* Represents a Partial Group DM Channel on Discord.
* @extends {Channel}
*/
class PartialGroupDMChannel extends Channel {
constructor(client, data) {
super(client, data);
/**
* The name of this Group DM Channel
* @type {string}
*/
this.name = data.name;
/**
* The hash of the channel icon
* @type {?string}
*/
this.icon = data.icon;
}
/**
* The URL to this channel's icon.
* @param {ImageURLOptions} [options={}] Options for the Image URL
* @returns {?string}
*/
iconURL({ format, size } = {}) {
if (!this.icon) return null;
return this.client.rest.cdn.GDMIcon(this.id, this.icon, format, size);
}
delete() {
return Promise.reject(new Error('DELETE_GROUP_DM_CHANNEL'));
}
fetch() {
return Promise.reject(new Error('FETCH_GROUP_DM_CHANNEL'));
}
}
module.exports = PartialGroupDMChannel;