mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
* add PartialGroupDMChannel class * fix lint * add new errors * add new class to Channel.create * fix lint * update typings accordingly * better implement errors * remove unnecessary functions * oops * lint * lint * lint * more lint * more lint * jsdoc typo * suggested changes * i did not forget the typings
47 lines
989 B
JavaScript
47 lines
989 B
JavaScript
'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;
|