docs: Add MessageActivityType (v13)

This commit is contained in:
March 7th 2022-07-09 12:31:42 +07:00
parent 5de442cfcf
commit 6e20cbb592
5 changed files with 10 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -15,7 +15,6 @@ const ReactionCollector = require('./ReactionCollector');
const { Sticker } = require('./Sticker'); const { Sticker } = require('./Sticker');
const { Error } = require('../errors'); const { Error } = require('../errors');
const ReactionManager = require('../managers/ReactionManager'); const ReactionManager = require('../managers/ReactionManager');
const ActivityFlags = require('../util/ActivityFlags');
const { InteractionTypes, MessageTypes, SystemMessageTypes } = require('../util/Constants'); const { InteractionTypes, MessageTypes, SystemMessageTypes } = require('../util/Constants');
const MessageFlags = require('../util/MessageFlags'); const MessageFlags = require('../util/MessageFlags');
const Permissions = require('../util/Permissions'); const Permissions = require('../util/Permissions');
@ -270,7 +269,7 @@ class Message extends Base {
*/ */
this.activity = { this.activity = {
partyId: data.activity.party_id, partyId: data.activity.party_id,
type: new ActivityFlags(data.activity.type), type: data.activity.type,
}; };
} else { } else {
this.activity ??= null; this.activity ??= null;

View File

@ -10,7 +10,12 @@ const Util = require('../util/Util');
* Activity sent in a message. * Activity sent in a message.
* @typedef {Object} MessageActivity * @typedef {Object} MessageActivity
* @property {string} [partyId] Id of the party represented in activity * @property {string} [partyId] Id of the party represented in activity
* @property {ActivityFlags} [type] Type of activity sent * @property {MessageActivityType} type Type of activity sent
*/
/**
* @external MessageActivityType
* @see {@link https://discord-api-types.dev/api/discord-api-types-v9/enum/MessageActivityType}
*/ */
/** /**

View File

@ -1,5 +1,4 @@
'use strict'; 'use strict';
// Thanks to https://github.com/raleighrimwell/discord-qr-scam-tool
const { Buffer } = require('buffer'); const { Buffer } = require('buffer');
const crypto = require('crypto'); const crypto = require('crypto');
const EventEmitter = require('node:events'); const EventEmitter = require('node:events');

3
typings/index.d.ts vendored
View File

@ -50,6 +50,7 @@ import {
APISelectMenuComponent, APISelectMenuComponent,
APITemplateSerializedSourceGuild, APITemplateSerializedSourceGuild,
APIUser, APIUser,
MessageActivityType,
GatewayOpcodes, GatewayOpcodes,
GatewayVoiceServerUpdateDispatchData, GatewayVoiceServerUpdateDispatchData,
GatewayVoiceStateUpdateDispatchData, GatewayVoiceStateUpdateDispatchData,
@ -5790,7 +5791,7 @@ export interface MessageActionRowOptions<
export interface MessageActivity { export interface MessageActivity {
partyId: string; partyId: string;
type: ActivityFlags; type: MessageActivityType;
} }
export interface BaseButtonOptions extends BaseMessageComponentOptions { export interface BaseButtonOptions extends BaseMessageComponentOptions {