Skip to content

Commit

Permalink
feat: support attachment flags
Browse files Browse the repository at this point in the history
  • Loading branch information
TTtie committed Jul 18, 2023
1 parent dec00b3 commit cc5af3b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1823,6 +1823,9 @@ declare namespace Dysnomia {
GATEWAY_MESSAGE_CONTENT_LIMITED: 524288;
APPLICATION_COMMAND_BADGE: 8388608;
};
AttachmentFlags: {
IS_REMIX: 4;
};
AuditLogActions: {
GUILD_UPDATE: 1;

Expand Down Expand Up @@ -2403,6 +2406,7 @@ declare namespace Dysnomia {
durationSecs?: number;
ephemeral?: boolean;
filename: string;
flags?: number;
height?: number;
id: string;
proxyURL: string;
Expand Down
4 changes: 4 additions & 0 deletions lib/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ module.exports.ApplicationFlags = {
APPLICATION_COMMAND_BADGE: 1 << 23
};

module.exports.AttachmentFlags = {
IS_REMIX: 1 << 2
};

module.exports.AuditLogActions = {
GUILD_UPDATE: 1,

Expand Down
4 changes: 4 additions & 0 deletions lib/structures/Attachment.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const Base = require("./Base");
* @prop {Number?} durationSecs The duration of the audio file (voice messages only)
* @prop {Boolean?} ephemeral Whether the attachment is ephemeral
* @prop {String} filename The filename of the attachment
* @prop {Number?} flags Attachment flags. See [Discord's documentation](https://discord.com/developers/docs/resources/channel#attachment-object-attachment-flags) for a list of them
* @prop {Number?} height The height of the attachment
* @prop {String} id The attachment ID
* @prop {String} proxyURL The proxy URL of the attachment
Expand Down Expand Up @@ -46,6 +47,9 @@ class Attachment extends Base {
if(data.ephemeral !== undefined) {
this.ephemeral = data.ephemeral;
}
if(data.flags !== undefined) {
this.flags = data.flags;
}
}

toJSON(props = []) {
Expand Down

0 comments on commit cc5af3b

Please sign in to comment.