From c489d572a29ed82499c64875d60ef216e00b563b Mon Sep 17 00:00:00 2001 From: Khaazz Date: Sun, 1 Dec 2019 16:17:03 +0100 Subject: [PATCH 1/6] Adds new Message flags --- lib/Constants.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Constants.js b/lib/Constants.js index a480ed2ca..16417fb2b 100644 --- a/lib/Constants.js +++ b/lib/Constants.js @@ -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 = { From 0c108a8abe29cbf593bf9bc86bd57b6b42524fa4 Mon Sep 17 00:00:00 2001 From: Khaazz Date: Sun, 1 Dec 2019 16:34:03 +0100 Subject: [PATCH 2/6] Adds Typescript definition for MessageFlags --- index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.d.ts b/index.d.ts index f48b4b1c0..e2f2edac7 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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; From f1f7144350daf8fa4719a46203e7e0151b77ba02 Mon Sep 17 00:00:00 2001 From: Khaazz Date: Sun, 1 Dec 2019 16:48:44 +0100 Subject: [PATCH 3/6] Actually add user.system --- index.d.ts | 1 + lib/structures/User.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/index.d.ts b/index.d.ts index e2f2edac7..dedaa8082 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1622,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; diff --git a/lib/structures/User.js b/lib/structures/User.js index a6042baff..943a74978 100644 --- a/lib/structures/User.js +++ b/lib/structures/User.js @@ -40,6 +40,9 @@ class User extends Base { if(data.discriminator !== undefined) { this.discriminator = data.discriminator; } + if(data.system !== undefined) { + this.system = data.system; + } } get mention() { From bc4139263353f79587bd35fd628a3621cc5ea086 Mon Sep 17 00:00:00 2001 From: Khaazz Date: Sun, 1 Dec 2019 16:57:43 +0100 Subject: [PATCH 4/6] Default user.system to false + jsdoc --- lib/structures/User.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/structures/User.js b/lib/structures/User.js index 943a74978..b338c590a 100644 --- a/lib/structures/User.js +++ b/lib/structures/User.js @@ -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 (part of the urgent message system) */ class User extends Base { constructor(data, client) { @@ -27,6 +28,7 @@ class User extends Base { } this._client = client; this.bot = !!data.bot; + this.system = !!data.system; this.update(data); } From 48ab57ed84f55ac3b753a0b294298850655195c3 Mon Sep 17 00:00:00 2001 From: Khaazz Date: Sun, 1 Dec 2019 17:06:10 +0100 Subject: [PATCH 5/6] Actually won't change so can be in constructor only --- lib/structures/User.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/structures/User.js b/lib/structures/User.js index b338c590a..1c3c954df 100644 --- a/lib/structures/User.js +++ b/lib/structures/User.js @@ -42,9 +42,6 @@ class User extends Base { if(data.discriminator !== undefined) { this.discriminator = data.discriminator; } - if(data.system !== undefined) { - this.system = data.system; - } } get mention() { From e341be57754dad8233a7eefc95a02dbe2f4ce270 Mon Sep 17 00:00:00 2001 From: abal Date: Mon, 2 Dec 2019 08:56:32 -0800 Subject: [PATCH 6/6] Update User.js --- lib/structures/User.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/structures/User.js b/lib/structures/User.js index 1c3c954df..40450694b 100644 --- a/lib/structures/User.js +++ b/lib/structures/User.js @@ -18,7 +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 (part of the urgent message system) +* @prop {Boolean} system Whether the user is an official Discord system user (e.g. urgent messages) */ class User extends Base { constructor(data, client) {