Skip to content

Commit 63f8bb6

Browse files
committed
refactor: requested changes
1 parent b1d5061 commit 63f8bb6

File tree

6 files changed

+24
-20
lines changed

6 files changed

+24
-20
lines changed

packages/discord.js/src/managers/GuildInviteManager.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,24 @@ class GuildInviteManager extends CachedManager {
4545
*/
4646

4747
/**
48-
* Data that can be resolved to a channel that an invite can be created on. This can be:
48+
* A guild channel where an invite may be created on. This can be:
4949
* - TextChannel
5050
* - VoiceChannel
5151
* - AnnouncementChannel
5252
* - StageChannel
5353
* - ForumChannel
5454
* - MediaChannel
55+
*
56+
* @typedef {TextChannel|VoiceChannel|AnnouncementChannel|StageChannel|ForumChannel|MediaChannel}
57+
* GuildInvitableChannel
58+
*/
59+
60+
/**
61+
* Data that can be resolved to a guild channel where an invite may be created on. This can be:
62+
* - GuildInvitableChannel
5563
* - Snowflake
56-
*
57-
* @typedef {TextChannel|VoiceChannel|AnnouncementChannel|StageChannel|ForumChannel|MediaChannel|Snowflake}
64+
*
65+
* @typedef {GuildInvitableChannel|Snowflake}
5866
* GuildInvitableChannelResolvable
5967
*/
6068

@@ -98,8 +106,9 @@ class GuildInviteManager extends CachedManager {
98106

99107
/**
100108
* Fetches invite(s) from Discord.
101-
*
102-
* @param {InviteResolvable|FetchInviteOptions|FetchInvitesOptions} [options] Options for fetching guild invite(s)
109+
*
110+
* @param {GuildInviteResolvable|FetchInviteOptions|FetchInvitesOptions} [options]
111+
* Options for fetching guild invite(s)
103112
* @returns {Promise<GuildInvite|Collection<string, GuildInvite>>}
104113
* @example
105114
* // Fetch all invites from a guild

packages/discord.js/src/structures/BaseInvite.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ const { Base } = require('./Base.js');
66
/**
77
* The base invite class.
88
* @extends {Base}
9-
* @abstract
109
*/
1110
class BaseInvite extends Base {
1211
constructor(client, data) {
1312
super(client);
1413

1514
/**
16-
* The type of this invite
15+
* The type of this invite.
1716
* @type {InviteType}
1817
*/
1918
this.type = data.type;

packages/discord.js/src/structures/GroupDMInvite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class GroupDMInvite extends BaseInvite {
2020
if ('channel' in data) {
2121
/**
2222
* The channel this invite is for.
23-
* @type {?BaseChannel}
23+
* @type {?PartialGroupDMChannel}
2424
*/
2525
this.channel =
2626
this.client.channels._add(data.channel, null, { cache: false }) ??

packages/discord.js/src/structures/GuildInvite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class GuildInvite extends BaseInvite {
5757
if ('channel' in data) {
5858
/**
5959
* The channel this invite is for.
60-
* @type {?BaseChannel}
60+
* @type {?GuildInvitableChannel}
6161
*/
6262
this.channel =
6363
this.client.channels._add(data.channel, this.guild, { cache: false }) ??

packages/discord.js/src/util/DataResolver.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ function resolveCode(data, regex) {
3636
}
3737

3838
/**
39-
* Resolves GuildInviteResolvable to an invite code.
39+
* Resolves InviteResolvable to an invite code.
4040
*
41-
* @param {GuildInviteResolvable} data The invite resolvable to resolve
41+
* @param {InviteResolvable} data The invite resolvable to resolve
4242
* @returns {string}
4343
* @private
4444
*/

packages/discord.js/typings/index.d.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,7 +2005,7 @@ export class InteractionWebhook {
20052005
public fetchMessage(message: Snowflake | '@original'): Promise<Message>;
20062006
}
20072007

2008-
export abstract class BaseInvite<WithCounts extends boolean = boolean> extends Base {
2008+
export class BaseInvite<WithCounts extends boolean = boolean> extends Base {
20092009
protected constructor(client: Client<true>, data: unknown);
20102010
public readonly type: InviteType;
20112011
public readonly code: string;
@@ -6359,14 +6359,10 @@ export interface InviteGenerationOptions {
63596359
scopes: readonly OAuth2Scopes[];
63606360
}
63616361

6362-
export type GuildInvitableChannelResolvable =
6363-
| AnnouncementChannel
6364-
| ForumChannel
6365-
| MediaChannel
6366-
| Snowflake
6367-
| StageChannel
6368-
| TextChannel
6369-
| VoiceChannel;
6362+
export type GuildInvitableChannel =
6363+
AnnouncementChannel | ForumChannel | MediaChannel | TextChannel | VoiceChannel;
6364+
6365+
export type GuildInvitableChannelResolvable = GuildInvitableChannel | Snowflake;
63706366

63716367
export interface InviteCreateOptions {
63726368
maxAge?: number;

0 commit comments

Comments
 (0)