mirror of
https://github.com/danbulant/discord.js
synced 2026-06-09 17:52:55 +00:00
feat: add new MessageFlags.FLAGS & User#system (#3603)
* feat: add new FLAGS * feat: add system property * typings: add User#system & new MessageFlagsStrings
This commit is contained in:
parent
330d5db586
commit
43782839ec
3 changed files with 15 additions and 1 deletions
|
|
@ -59,6 +59,13 @@ class User extends Base {
|
||||||
|
|
||||||
if (typeof data.bot !== 'undefined') this.bot = Boolean(data.bot);
|
if (typeof data.bot !== 'undefined') this.bot = Boolean(data.bot);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the user is an Official Discord System user (part of the urgent message system)
|
||||||
|
* @type {?boolean}
|
||||||
|
* @name User#system
|
||||||
|
*/
|
||||||
|
if (typeof data.system !== 'undefined') this.system = Boolean(data.system);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The locale of the user's client (ISO 639-1)
|
* The locale of the user's client (ISO 639-1)
|
||||||
* @type {?string}
|
* @type {?string}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@ class MessageFlags extends BitField {}
|
||||||
* * `CROSSPOSTED`
|
* * `CROSSPOSTED`
|
||||||
* * `IS_CROSSPOST`
|
* * `IS_CROSSPOST`
|
||||||
* * `SUPPRESS_EMBEDS`
|
* * `SUPPRESS_EMBEDS`
|
||||||
|
* * `SOURCE_MESSAGE_DELETED`
|
||||||
|
* * `URGENT`
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
* @see {@link https://discordapp.com/developers/docs/resources/channel#message-object-message-flags}
|
* @see {@link https://discordapp.com/developers/docs/resources/channel#message-object-message-flags}
|
||||||
*/
|
*/
|
||||||
|
|
@ -20,6 +22,8 @@ MessageFlags.FLAGS = {
|
||||||
CROSSPOSTED: 1 << 0,
|
CROSSPOSTED: 1 << 0,
|
||||||
IS_CROSSPOST: 1 << 1,
|
IS_CROSSPOST: 1 << 1,
|
||||||
SUPPRESS_EMBEDS: 1 << 2,
|
SUPPRESS_EMBEDS: 1 << 2,
|
||||||
|
SOURCE_MESSAGE_DELETED: 1 << 3,
|
||||||
|
URGENT: 1 << 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = MessageFlags;
|
module.exports = MessageFlags;
|
||||||
|
|
|
||||||
5
typings/index.d.ts
vendored
5
typings/index.d.ts
vendored
|
|
@ -1403,6 +1403,7 @@ declare module 'discord.js' {
|
||||||
public locale: string;
|
public locale: string;
|
||||||
public readonly partial: false;
|
public readonly partial: false;
|
||||||
public readonly presence: Presence;
|
public readonly presence: Presence;
|
||||||
|
public system?: boolean;
|
||||||
public readonly tag: string;
|
public readonly tag: string;
|
||||||
public username: string;
|
public username: string;
|
||||||
public avatarURL(options?: AvatarOptions): string | null;
|
public avatarURL(options?: AvatarOptions): string | null;
|
||||||
|
|
@ -1922,7 +1923,9 @@ declare module 'discord.js' {
|
||||||
|
|
||||||
type MessageFlagsString = 'CROSSPOSTED'
|
type MessageFlagsString = 'CROSSPOSTED'
|
||||||
| 'IS_CROSSPOST'
|
| 'IS_CROSSPOST'
|
||||||
| 'SUPPRESS_EMBEDS';
|
| 'SUPPRESS_EMBEDS'
|
||||||
|
| 'SOURCE_MESSAGE_DELETED'
|
||||||
|
| 'URGENT';
|
||||||
|
|
||||||
interface APIErrror {
|
interface APIErrror {
|
||||||
UNKNOWN_ACCOUNT: number;
|
UNKNOWN_ACCOUNT: number;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue