buddy

node MVC discord bot
Log | Files | Refs | README

MessageFlags.js (824B)


      1 'use strict';
      2 
      3 const BitField = require('./BitField');
      4 
      5 /**
      6  * Data structure that makes it easy to interact with an {@link Message#flags} bitfield.
      7  * @extends {BitField}
      8  */
      9 class MessageFlags extends BitField {}
     10 
     11 /**
     12  * @name MessageFlags
     13  * @kind constructor
     14  * @memberof MessageFlags
     15  * @param {BitFieldResolvable} [bits=0] Bit(s) to read from
     16  */
     17 
     18 /**
     19  * Numeric message flags. All available properties:
     20  * * `CROSSPOSTED`
     21  * * `IS_CROSSPOST`
     22  * * `SUPPRESS_EMBEDS`
     23  * * `SOURCE_MESSAGE_DELETED`
     24  * * `URGENT`
     25  * @type {Object}
     26  * @see {@link https://discordapp.com/developers/docs/resources/channel#message-object-message-flags}
     27  */
     28 MessageFlags.FLAGS = {
     29   CROSSPOSTED: 1 << 0,
     30   IS_CROSSPOST: 1 << 1,
     31   SUPPRESS_EMBEDS: 1 << 2,
     32   SOURCE_MESSAGE_DELETED: 1 << 3,
     33   URGENT: 1 << 4,
     34 };
     35 
     36 module.exports = MessageFlags;