chore: Miscellaneous backports

#9769 djs
This commit is contained in:
Elysia
2023-11-13 20:23:53 +07:00
parent d9e1b82fd2
commit fe6a30e074
12 changed files with 219 additions and 38 deletions

View File

@@ -0,0 +1,38 @@
'use strict';
const BitField = require('./BitField');
/**
* Data structure that makes it easy to interact with an {@link GuildMember#flags} bitfield.
* @extends {BitField}
*/
class AttachmentFlags extends BitField {}
/**
* @name AttachmentFlags
* @kind constructor
* @memberof AttachmentFlags
* @param {BitFieldResolvable} [bits=0] Bit(s) to read from
*/
/* eslint-disable max-len */
/**
* Numeric guild member flags. All available properties:
* * `IS_REMIX`
* @type {Object}
* @see {@link https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure-attachment-flags}
*/
AttachmentFlags.FLAGS = {
IS_REMIX: 1 << 2,
};
/**
* Data that can be resolved to give a guild attachment bitfield. This can be:
* * A string (see {@link AttachmentFlags.FLAGS})
* * A attachment flag
* * An instance of AttachmentFlags
* * An Array of AttachmentFlagsResolvable
* @typedef {string|number|AttachmentFlags|AttachmentFlagsResolvable[]} AttachmentFlagsResolvable
*/
module.exports = AttachmentFlags;

View File

@@ -360,6 +360,7 @@ exports.Opcodes = {
* * CALL_CREATE: callCreate
* * CALL_DELETE: callDelete
* * CALL_UPDATE: callUpdate
* * GUILD_AVAILABLE: guildAvailable
* * GUILD_CREATE: guildCreate
* * GUILD_DELETE: guildDelete
* * GUILD_UPDATE: guildUpdate
@@ -451,6 +452,7 @@ exports.Events = {
CALL_CREATE: 'callCreate',
CALL_DELETE: 'callDelete',
CALL_UPDATE: 'callUpdate',
GUILD_AVAILABLE: 'guildAvailable',
GUILD_CREATE: 'guildCreate',
GUILD_DELETE: 'guildDelete',
GUILD_UPDATE: 'guildUpdate',

37
src/util/RoleFlags.js Normal file
View File

@@ -0,0 +1,37 @@
'use strict';
const BitField = require('./BitField');
/**
* Data structure that makes it easy to interact with an {@link GuildMember#flags} bitfield.
* @extends {BitField}
*/
class RoleFlags extends BitField {}
/**
* @name RoleFlags
* @kind constructor
* @memberof RoleFlags
* @param {BitFieldResolvable} [bits=0] Bit(s) to read from
*/
/**
* Numeric guild member flags. All available properties:
* * `IN_PROMPT`
* @type {Object}
* @see {@link https://discord.com/developers/docs/topics/permissions#role-object-role-flags}
*/
RoleFlags.FLAGS = {
IN_PROMPT: 1 << 0,
};
/**
* Data that can be resolved to give a role flag bitfield. This can be:
* * A string (see {@link RoleFlags.FLAGS})
* * A role flag
* * An instance of RoleFlags
* * An Array of RoleFlagsResolvable
* @typedef {string|number|RoleFlags|RoleFlagsResolvable[]} RoleFlagsResolvable
*/
module.exports = RoleFlags;