types: More accurate types instead of GuildChannelResolvable (#6744)

This commit is contained in:
Jiralite
2021-10-03 14:01:38 +01:00
committed by GitHub
parent 9e421f6ccf
commit a8e60105fb
3 changed files with 27 additions and 6 deletions

View File

@@ -38,6 +38,18 @@ class GuildInviteManager extends CachedManager {
* @typedef {string} InviteResolvable
*/
/**
* Data that can be resolved to a channel that an invite can be created on. This can be:
* * TextChannel
* * VoiceChannel
* * NewsChannel
* * StoreChannel
* * StageChannel
* * Snowflake
* @typedef {TextChannel|VoiceChannel|NewsChannel|StoreChannel|StageChannel|Snowflake}
* GuildInvitableChannelResolvable
*/
/**
* Resolves an InviteResolvable to an Invite object.
* @method resolve
@@ -67,7 +79,8 @@ class GuildInviteManager extends CachedManager {
/**
* Options used to fetch all invites from a guild.
* @typedef {Object} FetchInvitesOptions
* @property {GuildChannelResolvable} [channelId] The channel to fetch all invites from
* @property {GuildInvitableChannelResolvable} [channelId]
* The channel to fetch all invites from
* @property {boolean} [cache=true] Whether or not to cache the fetched invites
*/
@@ -153,7 +166,7 @@ class GuildInviteManager extends CachedManager {
/**
* Create an invite to the guild from the provided channel.
* @param {GuildChannelResolvable} channel The options for creating the invite from a channel.
* @param {GuildInvitableChannelResolvable} channel The options for creating the invite from a channel.
* @param {CreateInviteOptions} [options={}] The options for creating the invite from a channel.
* @returns {Promise<Invite>}
* @example

View File

@@ -10,7 +10,7 @@ const { Error } = require('../errors');
class NewsChannel extends BaseGuildTextChannel {
/**
* Adds the target to this channel's followers.
* @param {GuildChannelResolvable} channel The channel where the webhook should be created
* @param {TextChannelResolvable} channel The channel where the webhook should be created
* @param {string} [reason] Reason for creating the webhook
* @returns {Promise<NewsChannel>}
* @example