Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds new Message flags #585

Merged
merged 7 commits into from Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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