Skip to content

Commit

Permalink
feat(Invite): type field support
Browse files Browse the repository at this point in the history
  • Loading branch information
TTtie committed Jun 13, 2024
1 parent 858ab06 commit 856a4ac
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ declare namespace Dysnomia {

// Invite
type InviteTargetTypes = Constants["InviteTargetTypes"][keyof Constants["InviteTargetTypes"]];
type InviteTypes = Constants["InviteTypes"][keyof Constants["InviteTypes"]];

// Message
type ActionRowComponents = Button | SelectMenu;
Expand Down Expand Up @@ -2164,6 +2165,11 @@ declare namespace Dysnomia {
STREAM: 1;
EMBEDDED_APPLICATION: 2;
};
InviteTypes: {
GUILD: 0;
GROUP_DM: 1;
FRIEND: 2;
};
MFALevels: {
NONE: 0;
ELEVATED: 1;
Expand Down Expand Up @@ -3285,6 +3291,7 @@ declare namespace Dysnomia {
targetType?: InviteTargetTypes;
targetUser?: User;
temporary: CT extends "withMetadata" ? boolean : null;
type: InviteTypes;
uses: CT extends "withMetadata" ? number : null;
constructor(data: BaseData, client: Client);
delete(reason?: string): Promise<void>;
Expand Down
6 changes: 6 additions & 0 deletions lib/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,12 @@ module.exports.InviteTargetTypes = {
EMBEDDED_APPLICATION: 2
};

module.exports.InviteTypes = {
GUILD: 0,
GROUP_DM: 1,
FRIEND: 2
};

module.exports.MFALevels = {
NONE: 0,
ELEVATED: 1
Expand Down
5 changes: 5 additions & 0 deletions lib/structures/Invite.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ class Invite extends Base {
* @type {String}
*/
this.code = data.code;
/**
* The invite type
* @type {Number}
*/
this.type = data.type;
if(data.guild && client.guilds.has(data.guild.id)) {
/**
* Info on the invite channel
Expand Down

0 comments on commit 856a4ac

Please sign in to comment.