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