mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
src: support new message fields (#3388)
* src: Update channel pattern * src: Remove useless non-capture group * src: it's as though we're starting fresh * src: Bring this up to date for reals now * src: typings and a bug fix * src: Add crossposted channels to message mentions * src: Requested changes and add typings * src: Move Object.keys outside loop * typings: Fix enum being exported when it shouldn't * src: Consistency with roles and users * docs: Correct docstring for MessageFlags#flags * docs: Correct docstring for MessageMentions#crosspostedChannels * docs: Suggestions Co-authored-by: SpaceEEC * src: Reset flags to 0 if no flags are received on MESSAGE_UPDATE
This commit is contained in:
25
src/util/MessageFlags.js
Normal file
25
src/util/MessageFlags.js
Normal file
@@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
const BitField = require('./BitField');
|
||||
|
||||
/**
|
||||
* Data structure that makes it easy to interact with an {@link Message#flags} bitfield.
|
||||
* @extends {BitField}
|
||||
*/
|
||||
class MessageFlags extends BitField {}
|
||||
|
||||
/**
|
||||
* Numeric message flags. All available properties:
|
||||
* * `CROSSPOSTED`
|
||||
* * `IS_CROSSPOST`
|
||||
* * `SUPPRESS_EMBEDS`
|
||||
* @type {Object}
|
||||
* @see {@link https://discordapp.com/developers/docs/resources/channel#message-object-message-flags}
|
||||
*/
|
||||
MessageFlags.FLAGS = {
|
||||
CROSSPOSTED: 1 << 0,
|
||||
IS_CROSSPOST: 1 << 1,
|
||||
SUPPRESS_EMBEDS: 1 << 2,
|
||||
};
|
||||
|
||||
module.exports = MessageFlags;
|
||||
Reference in New Issue
Block a user