[Streams] Game allow list for stream alerts #4174
No reviewers
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!4174
Loading…
Reference in a new issue
No description provided.
Delete branch "palmtree5/V3/enhancement/streamalert_gamefilter"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Description of the changes
Game filter for stream alerts. Should ultimately support Twitch and Smashcast unless anything has changed with regards to the idea in Youtube or Picarto's APIs. Replacement for #2433, fixes #2356 and #3654
Quick look at api docs to refresh myself tells me that Youtube is a definite no. Picarto actually does have categories (which are given as a string when retrieving a stream but have more data beyond that if grabbing the list of categories and thus the category name can be validated) that could be used to filter but this assumes that is something that can change from stream to stream, which I'm ultimately not sure on simply because I'm not at all familiar with Picarto. If anyone happens to have insight into this, feel free to let me know
Twitch and Smashcast support have been implemented. Haven't touched Picarto for the reasons I mentioned in https://github.com/Cog-Creators/Red-DiscordBot/pull/4174#issuecomment-671114687
Otherwise, this needs testing (I haven't really done much testing of this myself)
So to start after a full day of testing...
twitch: it works fine and all commands works. but when adding a game for the specified channel it does not send alert.
smashcast: i got into an issue by using
streamalert smashcast addgame <channel_name> <game_name>.The issue with
[p]streamalert smashcast addgameshould be fixed nowi'm getting it with
[p]streamalert smashcast removegametoo.yeah, that would be the result of copying and pasting and changing what needed to be changed lol
Which is now fixed
So, testing have been done, no more issues found, and it sends the correct game from twitch and smashcast. it just takes longer to get notified than i though, about 3 - 5 minutes to wait, but other than that, it works great, i really like this.
also, just to leave about this:
generator object pagify. it shows when youaddgameandremovegameon smashcast alerts, which i found a bit confused, so not sure if it should be like that.yeah, that would be a bug
@palmtree5 So to move forward with this, we need a decision for Picarto?
It seems like the categories (called communities on their site) aren't as specific when it comes to games, but I think Picarto is focusing more on creative work and so there are more specific categories related to that. I think it would probably be useful for Picarto users, but I wouldn't say it's that important for Red to support them until we get a feature request for it. But if you do want to spend time to write it even though it might not really be used, I would say go for it.
Yeah, I don't know that it's particularly important to make sure Picarto support is in as the major thing with this (since Mixer died) was Twitch support. I'm honestly not even sure how many people use the Picarto-specific commands. Basically, I agree with waiting on that until someone specifically requests it
Merge conflicts have been resolved for this and the bug @maxbooiii mentioned above has been fixed. Should probably make sure to test this just in case something broke in the process of resolving the merge conflicts though
Merge conflicts have been taken care of, though this will definitely require testing to ensure nothing broke by fixing merge conflicts
I can't get this function to work, and the help menu isn't very straightforward. I tried running
[p]streamalert twitch sp00nd addgame Call of Duty: Black Ops- This is exactly how the game is labeled on Twitch. I have also tried putting it in quotes with the to the same effect.and I get the same feedback as if I was just running
[p]streamalert twitch sp00ndFurthermore,
[p]streamalert listdoes not show any game filter, only the Twitch channel and the Discord channel for alerts. What am I missing?The bot isn't announcing anything at all. Even without a filter. So i'm not sure of the function as it stands.
@sp00nd It's a subcommand. The help should tell you that it's
[p]streamalert twitch addgame <channel_name> <game_name>I tried that first, and figured it was wrong as it was spitting back
Error in command 'streamalert twitch addgame'. Check your console or logs for details.yeah, it looks like that function got removed when I fixed merge conflicts. I'll get this fixed
Ok, try updating and then that issue should be fixed
I ran
python -m pip install -U --force-reinstall --no-cache git+https://github.com/palmtree5/Red-DiscordBot.git@V3/enhancement/streamalert_gamefilter#egg=Red-DiscordBotin my venv and restarted the bot.Upon running the command, it is no longer erroring out. However, I am getting
Could not find the game requested. Make sure the game name matches how it appears on Twitch.when using several different category names, including ones as simple as "Music". (edit: I have tried quotes on and off, same result.)How exactly should the game name be when it refers to
how it appears on Twitch?There is no other "appearance" besides the game name itself under the category.
Exactly this. Copy and paste the game name from the game's page on Twitch
This is exactly what I have been doing, and it is not recognizing them. Like I mentioned,
including ones as simple as "Music"Is there any way I can provide more logging on this error? I have not been able to get any category working from what i've seen. Used a fresh API key also when troubleshooting this.
I've actually figured out how to go about using IGDB's API to potentially just allow a search of their API for the user's desired game, which would potentially allow the user to do something like
[p]streamalert twitch addgame <channel_name> zelda, which would then call out to IGDB's API to search, returning the list to the user to select a game from and then use the game's IGDB id to then get the game's data from Twitch (since the ID in the/helix/streamsendpoint is not the game's IGDB ID, we still need to get Twitch's ID for the game the user selected). This seems like it could be a little more user-friendly in some ways than making the user copy and paste the name from the game's directory page on TwitchIs there an opportunity anywhere in here to add support for filtering by words in stream title and by tags as well?
More context: https://github.com/Cog-Creators/Red-DiscordBot/issues/2356#issuecomment-2200683328
This PR was ported to the current codebase in
77825d863instead of being merged as-is:Rewritten: the original PR didn't work (e.g. super.init typo, changed
is_online() return value without updating all callers, KeyError for games
that weren't added). Games are now looked up through the Twitch API instead
of IGDB. Also fix Twitch rate limit retries dropping request parameters.