feat(eventsub): implement channel.chat.user_message_(hold/update) (#6008)

This commit is contained in:
pajlada
2025-03-01 17:00:40 +01:00
committed by GitHub
parent f4541b0208
commit c03b883f05
22 changed files with 1123 additions and 1 deletions
@@ -0,0 +1,105 @@
{
"input": {
"broadcaster_user_id": "11148817",
"broadcaster_user_login": "pajlada",
"broadcaster_user_name": "pajlada",
"message": {
"fragments": [
{
"cheermote": null,
"emote": null,
"text": "penis penis penis",
"type": "text"
}
],
"text": "penis penis penis"
},
"message_id": "e39e3c58-3d25-49fd-8c94-e776ef57a7f8",
"user_id": "159849156",
"user_login": "bajlada",
"user_name": "BajLada"
},
"output": [
{
"badgeInfos": {
},
"badges": [
],
"channelName": "pajlada",
"count": 1,
"displayName": "",
"elements": [
{
"emote": {
"homePage": "https://dashboard.twitch.tv/settings/moderation/automod",
"images": {
"1x": ""
},
"name": "",
"tooltip": "AutoMod"
},
"flags": "BadgeChannelAuthority",
"link": {
"type": "None",
"value": ""
},
"tooltip": "AutoMod",
"trailingSpace": true,
"type": "BadgeElement"
},
{
"color": "#ff0000ff",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMediumBold",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"AutoMod:"
]
},
{
"color": "Text",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"Hey!",
"Your",
"message",
"is",
"being",
"checked",
"by",
"mods",
"and",
"has",
"not",
"been",
"sent."
]
}
],
"flags": "Timeout|PubSub|AutoMod|EventSub",
"id": "automod_e39e3c58-3d25-49fd-8c94-e776ef57a7f8",
"localizedName": "",
"loginName": "automod",
"messageText": "AutoMod: Hey! Your message is being checked by mods and has not been sent.",
"searchText": "AutoMod: Hey! Your message is being checked by mods and has not been sent.",
"serverReceivedTime": "2024-05-14T12:31:47Z",
"timeoutUser": "",
"userID": "",
"usernameColor": "#ff000000"
}
]
}
@@ -0,0 +1,98 @@
{
"input": {
"broadcaster_user_id": "11148817",
"broadcaster_user_login": "pajlada",
"broadcaster_user_name": "pajlada",
"message": {
"fragments": [
{
"cheermote": null,
"emote": null,
"text": "penis ass penis",
"type": "text"
}
],
"text": "penis ass penis"
},
"message_id": "5686ec52-e02c-4042-ac21-1dfd8cab0f9f",
"status": "approved",
"user_id": "159849156",
"user_login": "bajlada",
"user_name": "BajLada"
},
"output": [
{
"badgeInfos": {
},
"badges": [
],
"channelName": "pajlada",
"count": 1,
"displayName": "",
"elements": [
{
"emote": {
"homePage": "https://dashboard.twitch.tv/settings/moderation/automod",
"images": {
"1x": ""
},
"name": "",
"tooltip": "AutoMod"
},
"flags": "BadgeChannelAuthority",
"link": {
"type": "None",
"value": ""
},
"tooltip": "AutoMod",
"trailingSpace": true,
"type": "BadgeElement"
},
{
"color": "#ff0000ff",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMediumBold",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"AutoMod:"
]
},
{
"color": "Text",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"Mods",
"have",
"accepted",
"your",
"message."
]
}
],
"flags": "Timeout|PubSub|AutoMod|EventSub",
"id": "automod_5686ec52-e02c-4042-ac21-1dfd8cab0f9f",
"localizedName": "",
"loginName": "automod",
"messageText": "AutoMod: Mods have accepted your message.",
"searchText": "AutoMod: Mods have accepted your message.",
"serverReceivedTime": "2024-05-14T12:31:47Z",
"timeoutUser": "",
"userID": "",
"usernameColor": "#ff000000"
}
]
}
@@ -0,0 +1,104 @@
{
"input": {
"broadcaster_user_id": "11148817",
"broadcaster_user_login": "pajlada",
"broadcaster_user_name": "pajlada",
"message": {
"fragments": [
{
"cheermote": null,
"emote": null,
"text": "penis ",
"type": "text"
},
{
"cheermote": null,
"emote": null,
"text": "ass penis",
"type": "text"
}
],
"text": "penis ass penis"
},
"message_id": "fc90dc3b-0634-41c3-8365-f40719f076ab",
"status": "denied",
"user_id": "159849156",
"user_login": "bajlada",
"user_name": "BajLada"
},
"output": [
{
"badgeInfos": {
},
"badges": [
],
"channelName": "pajlada",
"count": 1,
"displayName": "",
"elements": [
{
"emote": {
"homePage": "https://dashboard.twitch.tv/settings/moderation/automod",
"images": {
"1x": ""
},
"name": "",
"tooltip": "AutoMod"
},
"flags": "BadgeChannelAuthority",
"link": {
"type": "None",
"value": ""
},
"tooltip": "AutoMod",
"trailingSpace": true,
"type": "BadgeElement"
},
{
"color": "#ff0000ff",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMediumBold",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"AutoMod:"
]
},
{
"color": "Text",
"flags": "Text",
"link": {
"type": "None",
"value": ""
},
"style": "ChatMedium",
"tooltip": "",
"trailingSpace": true,
"type": "TextElement",
"words": [
"Mods",
"have",
"denied",
"your",
"message."
]
}
],
"flags": "Timeout|PubSub|AutoMod|EventSub",
"id": "automod_fc90dc3b-0634-41c3-8365-f40719f076ab",
"localizedName": "",
"loginName": "automod",
"messageText": "AutoMod: Mods have denied your message.",
"searchText": "AutoMod: Mods have denied your message.",
"serverReceivedTime": "2024-05-14T12:31:47Z",
"timeoutUser": "",
"userID": "",
"usernameColor": "#ff000000"
}
]
}
+38
View File
@@ -120,6 +120,44 @@ const std::map<QString, std::string_view, QCompareCaseInsensitive>
"cost": 0
})",
},
{
"channel-chat-user-message-hold",
R"({
"id": "a3122e32-6498-4847-8675-109b9b94f29c",
"status": "enabled",
"type": "channel.chat.user_message_hold",
"version": "1",
"condition": {
"broadcaster_user_id": "11148817",
"moderator_user_id": "489584266"
},
"transport": {
"method":"websocket",
"session_id":"AgoQ59RRLw0mS6S000QtK8f54BIGY2VsbC1j"
},
"created_at": "2025-02-28T15:55:37.85489173Z",
"cost": 0
})",
},
{
"channel-chat-user-message-update",
R"({
"id": "a3122e32-6498-4847-8675-109b9b94f29c",
"status": "enabled",
"type": "channel.chat.user_message_update",
"version": "1",
"condition": {
"broadcaster_user_id": "11148817",
"moderator_user_id": "489584266"
},
"transport": {
"method":"websocket",
"session_id":"AgoQ59RRLw0mS6S000QtK8f54BIGY2VsbC1j"
},
"created_at": "2025-02-28T15:55:37.85489173Z",
"cost": 0
})",
},
};
class MockApplication : public mock::BaseApplication