Skip to content

Commit

Permalink
Add new Message flags (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaaz authored and abalabahaha committed Dec 4, 2019
1 parent 65dda68 commit d68dba5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions index.d.ts
Expand Up @@ -273,6 +273,13 @@ declare namespace Eris {
INTEGRATION_UPDATE: 81;
INTEGRATION_DELETE: 82;
};
MessageFlags: {
CROSSPOSTED: 0;
IS_CROSSPOST: 2;
SUPPRESS_EMBEDS: 4;
SOURCE_MESSAGE_DELETED: 8;
URGENT: 16;
};
MessageTypes: {
DEFAULT: 0;
RECIPIENT_ADD: 1;
Expand Down Expand Up @@ -1615,6 +1622,7 @@ declare namespace Eris {
defaultAvatarURL: string;
avatarURL: string;
staticAvatarURL: string;
system: boolean;
constructor(data: BaseData, client: Client);
dynamicAvatarURL(format?: string, size?: number): string;
getDMChannel(): Promise<PrivateChannel>;
Expand Down
4 changes: 3 additions & 1 deletion lib/Constants.js
Expand Up @@ -170,7 +170,9 @@ module.exports.AuditLogActions = {
module.exports.MessageFlags = {
CROSSPOSTED: 1 << 0,
IS_CROSSPOST: 1 << 1,
SUPPRESS_EMBEDS: 1 << 2
SUPPRESS_EMBEDS: 1 << 2,
SOURCE_MESSAGE_DELETED: 1 << 3,
URGENT: 1 << 4
};

module.exports.MessageTypes = {
Expand Down
2 changes: 2 additions & 0 deletions lib/structures/User.js
Expand Up @@ -18,6 +18,7 @@ const {ImageSizeBoundaries, ImageFormats} = require("../Constants");
* @prop {String} defaultAvatarURL The URL of the user's default avatar
* @prop {String} avatarURL The URL of the user's avatar which can be either a JPG or GIF
* @prop {String} staticAvatarURL The URL of the user's avatar (always a JPG)
* @prop {Boolean} system Whether the user is an official Discord system user (e.g. urgent messages)
*/
class User extends Base {
constructor(data, client) {
Expand All @@ -27,6 +28,7 @@ class User extends Base {
}
this._client = client;
this.bot = !!data.bot;
this.system = !!data.system;
this.update(data);
}

Expand Down

0 comments on commit d68dba5

Please sign in to comment.