alveusgg / extension

Twitch extension for Alveus Sanctuary, allowing stream viewers to learn more about the ambassadors at the sanctuary.
https://www.twitch.tv/alveussanctuary
Other
64 stars 15 forks source link

[Idea]: Always connect to AlveusGG channel #152

Closed MattIPv4 closed 7 months ago

MattIPv4 commented 8 months ago

As a way to provide Alveus mods with control over the extension during collaborations, without needing them all added as REACT_APP_CHAT_COMMANDS_PRIVILEGED_USERS, always connect to the AlveusGG channel (perhaps REACT_APP_EXTRA_CHANNEL_NAMES) alongside whatever channel the extension is running it.

To avoid the extension on the main Alveus channel triggering when mods in AlveusGG are running commands for the collaboration, REACT_APP_EXTRA_CHANNEL_NAMES should only be used when the current channel is not in REACT_APP_DEFAULT_CHANNEL_NAMES.

I think the implementation should be something like:

https://github.com/alveusgg/extension/blob/fc2b989f162d55d503e16474e21d3c58b9d41815/src/hooks/useChatCommand.ts#L53

⬇️

    () => [...testChannelNames, ...(channel ? [channel, ...(defaultChannelNames.includes(channel) ? [] : extraChannelNames)] : defaultChannelNames)],