From 62ce83a7f609b56f3152a5c58ec2c0d4e5881950 Mon Sep 17 00:00:00 2001 From: Przemek Pawlas <3606072+Destroy666x@users.noreply.github.com> Date: Sat, 5 Oct 2024 16:04:01 +0200 Subject: [PATCH] Add one more Twitch chat tag temp var --- data/locale/en-US.ini | 2 ++ plugins/twitch/macro-condition-twitch.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index 9011dae3..2b3a0a89 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -1752,6 +1752,8 @@ AdvSceneSwitcher.tempVar.twitch.emotes.chatReceive="Chatter badges" AdvSceneSwitcher.tempVar.twitch.emotes.chatReceive.description="A string describing all the emotes in the message - the emote ID and comma-separated all positions of emotes with that ID.\nFor example: 25:0-4,12-16/1902:6-10" AdvSceneSwitcher.tempVar.twitch.timestamp.chatReceive="Chat message timestamp" AdvSceneSwitcher.tempVar.twitch.timestamp.chatReceive.description="The Unix timestamp representing when the chat message was sent, in milliseconds." +AdvSceneSwitcher.tempVar.twitch.is_emotes_only.chatReceive="Is using only emotes" +AdvSceneSwitcher.tempVar.twitch.is_emotes_only.chatReceive.description="'true' if the message consists only of emotes, 'false' otherwise." AdvSceneSwitcher.tempVar.twitch.is_first_message.chatReceive="Is chatter's first message" AdvSceneSwitcher.tempVar.twitch.is_first_message.chatReceive.description="'true' if the chatter has never sent messages in the channel before, 'false' otherwise." AdvSceneSwitcher.tempVar.twitch.is_mod.chatReceive="Is chatter a moderator" diff --git a/plugins/twitch/macro-condition-twitch.cpp b/plugins/twitch/macro-condition-twitch.cpp index b391139c..514a49fd 100644 --- a/plugins/twitch/macro-condition-twitch.cpp +++ b/plugins/twitch/macro-condition-twitch.cpp @@ -418,6 +418,10 @@ bool MacroConditionTwitch::CheckChatMessages(TwitchToken &token) SetTempVarValue("emotes", message->properties.emotesString); SetTempVarValue("timestamp", std::to_string(message->properties.timestamp)); + SetTempVarValue("is_emotes_only", + message->properties.isUsingOnlyEmotes + ? "true" + : "false"); SetTempVarValue("is_first_message", message->properties.isFirstMessage ? "true" : "false"); @@ -1292,6 +1296,7 @@ void MacroConditionTwitch::SetupTempVars() setupTempVarHelper("color", ".chatReceive"); setupTempVarHelper("emotes", ".chatReceive"); setupTempVarHelper("timestamp", ".chatReceive"); + setupTempVarHelper("is_emotes_only", ".chatReceive"); setupTempVarHelper("is_first_message", ".chatReceive"); setupTempVarHelper("is_mod", ".chatReceive"); setupTempVarHelper("is_subscriber", ".chatReceive");