Skip to content

Commit 17d4c78

Browse files
authored
feat(Invite): add type (discordjs#10280)
1 parent 3b5c600 commit 17d4c78

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

packages/discord.js/src/structures/Invite.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ class Invite extends Base {
2222

2323
constructor(client, data) {
2424
super(client);
25+
26+
/**
27+
* The type of this invite
28+
* @type {InviteType}
29+
*/
30+
this.type = data.type;
31+
2532
this._patch(data);
2633
}
2734

packages/discord.js/src/util/APITypes.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,11 @@
410410
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/InteractionResponseType}
411411
*/
412412

413+
/**
414+
* @external InviteType
415+
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/InviteType}
416+
*/
417+
413418
/**
414419
* @external InviteTargetType
415420
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/InviteTargetType}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ import {
180180
APIPollAnswer,
181181
APISelectMenuDefaultValue,
182182
SelectMenuDefaultValueType,
183+
InviteType,
183184
} from 'discord-api-types/v10';
184185
import { ChildProcess } from 'node:child_process';
185186
import { EventEmitter } from 'node:events';
@@ -1990,6 +1991,7 @@ export class Invite extends Base {
19901991
public targetUser: User | null;
19911992
public targetType: InviteTargetType | null;
19921993
public temporary: boolean | null;
1994+
public type: InviteType;
19931995
public get url(): string;
19941996
public uses: number | null;
19951997
public delete(reason?: string): Promise<Invite>;

0 commit comments

Comments
 (0)