diff options
author | sowgro <tpoke.ferrari@gmail.com> | 2023-09-02 19:12:47 -0400 |
---|---|---|
committer | sowgro <tpoke.ferrari@gmail.com> | 2023-09-02 19:12:47 -0400 |
commit | e4450c8417624b71d779cb4f41692538f9165e10 (patch) | |
tree | b70826542223ecdf8a7a259f61b0a1abb8a217d8 /node_modules/discord.js/src/structures/PartialGroupDMChannel.js | |
download | sowbot3-e4450c8417624b71d779cb4f41692538f9165e10.tar.gz sowbot3-e4450c8417624b71d779cb4f41692538f9165e10.tar.bz2 sowbot3-e4450c8417624b71d779cb4f41692538f9165e10.zip |
first commit
Diffstat (limited to 'node_modules/discord.js/src/structures/PartialGroupDMChannel.js')
-rw-r--r-- | node_modules/discord.js/src/structures/PartialGroupDMChannel.js | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/node_modules/discord.js/src/structures/PartialGroupDMChannel.js b/node_modules/discord.js/src/structures/PartialGroupDMChannel.js new file mode 100644 index 0000000..ecbb878 --- /dev/null +++ b/node_modules/discord.js/src/structures/PartialGroupDMChannel.js @@ -0,0 +1,60 @@ +'use strict'; + +const { BaseChannel } = require('./BaseChannel'); +const { DiscordjsError, ErrorCodes } = require('../errors'); + +/** + * Represents a Partial Group DM Channel on Discord. + * @extends {BaseChannel} + */ +class PartialGroupDMChannel extends BaseChannel { + constructor(client, data) { + super(client, data); + + // No flags are present when fetching partial group DM channels. + this.flags = null; + + /** + * 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; + + /** + * Recipient data received in a {@link PartialGroupDMChannel}. + * @typedef {Object} PartialRecipient + * @property {string} username The username of the recipient + */ + + /** + * The recipients of this Group DM Channel. + * @type {PartialRecipient[]} + */ + this.recipients = data.recipients; + } + + /** + * The URL to this channel's icon. + * @param {ImageURLOptions} [options={}] Options for the image URL + * @returns {?string} + */ + iconURL(options = {}) { + return this.icon && this.client.rest.cdn.channelIcon(this.id, this.icon, options); + } + + delete() { + return Promise.reject(new DiscordjsError(ErrorCodes.DeleteGroupDMChannel)); + } + + fetch() { + return Promise.reject(new DiscordjsError(ErrorCodes.FetchGroupDMChannel)); + } +} + +module.exports = PartialGroupDMChannel; |