component v2 1

This commit is contained in:
TotallyTung
2025-06-23 19:16:41 +07:00
committed by GitHub
parent 4cd6390758
commit 714f8bd5de
3 changed files with 9 additions and 1 deletions

View File

@@ -49,6 +49,7 @@ class BaseMessageComponent {
* The type of this component * The type of this component
* @type {?MessageComponentType} * @type {?MessageComponentType}
*/ */
this.rawData = data;
this.type = 'type' in data ? BaseMessageComponent.resolveType(data.type) : null; this.type = 'type' in data ? BaseMessageComponent.resolveType(data.type) : null;
} }

View File

@@ -57,7 +57,7 @@ MessageFlags.FLAGS = {
SUPPRESS_NOTIFICATIONS: 1 << 12, SUPPRESS_NOTIFICATIONS: 1 << 12,
IS_VOICE_MESSAGE: 1 << 13, IS_VOICE_MESSAGE: 1 << 13,
HAS_SNAPSHOT: 1 << 14, HAS_SNAPSHOT: 1 << 14,
IS_UIKIT_COMPONENTS: 1 << 15, IS_COMPONENTS_V2: 1 << 15,
}; };
module.exports = MessageFlags; module.exports = MessageFlags;

7
typings/enums.d.ts vendored
View File

@@ -226,6 +226,13 @@ export const enum MessageComponentTypes {
ROLE_SELECT = 6, ROLE_SELECT = 6,
MENTIONABLE_SELECT = 7, MENTIONABLE_SELECT = 7,
CHANNEL_SELECT = 8, CHANNEL_SELECT = 8,
SELECTION = 9,
TEXT_DISPLAY = 10,
THUMBNAIL = 11,
MEDIA_GALLERY = 12,
FILE = 13,
SEPARATOR = 14,
CONTAINER = 17,
} }
export const enum SelectMenuComponentTypes { export const enum SelectMenuComponentTypes {