feat: Shared Chat Replace Variables (#2846) #3315
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
This PR adds additional logic for shared chat, including a cache for the shared chat session which is updated on chat connect and when Twitch sends an EventSub event for shared chat started, updated or ended
The following variables are added:
Applicable Issues
#2846
Testing
Ensured Firebot starts
Ensured Firebot connects to chat
Ensured variables appear in variables menu
Ensured when starting a shared chat session, the shared chat participants are loaded into the cache and available through variables
Ensured isSharedChatEnabled and sharedChatParticipants variables are always available
Ensured sharedChatSourceUser, sharedChatSourceUsername, sharedChatSourceDisplayName and sharedChatSourceUserId are only available in chat messages and chat message events
Ensured all above variables resolve to correct data (eg. correct source channel, correct shared chat state)
Ensured when connecting to chat, the current shared chat session is fetched and loaded into the cache
Ensured the Shared Chat Session Started event fires when a shared chat session is started
Ensured the Shared Chat Session Updated event fires when a streamer joins or leaves the shared chat session
Ensured the Shared Chat Session Ended event fires when the shared chat session is ended