This is a VS Code extension that will allow your Twitch chat to highlight a line of code via a command message. Example: `!line 8 server.js`. See master branch README.md for more details
We need a way for broadcasters to limit who can use this command. This PR allows the broadcaster to set the required badges a user must have in order to use the command. Users who do not have the badge will be ignored. The broadcaster will always be allowed to use the command.
Changed files
package.json Added a new setting to capture the required badges: twitchHighlighter.requiredBadges
constants.ts Added the new setting to the constants.
twitchChatClient.ts Forwards the requiredBadges (array) setting to the twitch server using the start params.
twitchLanguageServer.ts Captures the badges when a user sends a message and verifies the user has a required badge before continuing to parse the message for our highlight command.
twitchLanguageServer.test.ts Added the new parameter requirements for the parseMessage function and added tests to ensure the requiredBadges exists and fails (as we expect) when they don't.
Purpose
We need a way for broadcasters to limit who can use this command. This PR allows the broadcaster to set the required badges a user must have in order to use the command. Users who do not have the badge will be ignored. The broadcaster will always be allowed to use the command.
Changed files
package.json
Added a new setting to capture the required badges:twitchHighlighter.requiredBadges
constants.ts
Added the new setting to the constants.twitchChatClient.ts
Forwards the requiredBadges (array) setting to the twitch server using the start params.twitchLanguageServer.ts
Captures the badges when a user sends a message and verifies the user has a required badge before continuing to parse the message for our highlight command.twitchLanguageServer.test.ts
Added the new parameter requirements for theparseMessage
function and added tests to ensure the requiredBadges exists and fails (as we expect) when they don't.Partially Addresses
51