Add YouTube notifications to the notify hybrid group - #10
Open
goodmorningkay wants to merge 1 commit into
Open
Conversation
Extend the notify group with YouTube channel follows supporting uploads/live/both event choices, guild and DM scoping, mentions, channel routing, and event-type editing. Mirrors the existing Twitch/anime command structure. - notify add youtube <channel> [events], notify youtube shorthand - notify remove/mention/events/list/channel youtube - youtube_follows gains user_id, id identity PK, mention columns; guild PK becomes UNIQUE so DM rows fit and website ON CONFLICT holds - youtube_announcement_deliveries gains user_id + scope-keyed partial unique indexes for DM delivery dedup - delivery resolves channel vs DM destination and honors per-follow mentions; channel search autocomplete via Google API - youtube_follows added to privacy USER_ID_TABLES - tests for event mapping, list rendering, owner/destination, and guild vs DM delivery claim scoping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Extend the
notifyhybrid group with YouTube channel follows. Users can now follow a YouTube channel and choose whether to be notified for uploads, live streams, or both, in a server or by DM — mirroring the existing Twitch/anime command structure.What was added
Commands (all hybrid, guild + DM)
notify add youtube <channel> [events]—events=uploads/live/both(defaultboth), with channel-search autocompletenotify youtube <channel> [events]— shorthand for the abovenotify remove youtube <follow>— by follow ID, channel name, or channel URLnotify mention youtube <follow> [mention]— set/clear a role or @everyone mentionnotify events youtube <follow> <events>— change an existing follow's event typenotify list youtube— list followed channels; YouTube also appears as a section innotify listnotify channel youtube— guild-only routing to a server text channelBackend (
extensions/events/youtube.py)_dispatch_youtube_itemnow selectsuser_id,mention_role_id,mention_everyone_youtube_owner+_youtube_destinationresolve a follow's channel or DM destinationnotify_allowed_mentions) and can DM the ownersearch_youtube_channels(Google API) for add autocompleteMigration
0093_youtube_notify_follows.sqlyoutube_follows: addsuser_id, anididentity primary key,mention_role_id/mention_everyone; the(guild_id, youtube_channel_id)primary key becomes a UNIQUE constraint so DM rows fit while the website'sON CONFLICT (guild_id, youtube_channel_id)inserts keep workingyoutube_announcement_deliveries: addsuser_idand scope-keyed partial unique indexes for DM delivery dedupOther
youtube_followsadded toUSER_ID_TABLESincore/privacy.pyfor GDPR wipesnotify list/ landing text updated to mention YouTubeTesting
tests/test_notify_youtube.pycovering event mapping, list rendering, owner/destination resolution, and guild vs DM delivery-claim scopingON CONFLICT, owner check, id auto-increment, delivery dedup by both scopes, and the runtime claim SQL partial-index match)add/remove/mention/events/list/channel;notify add youtubeexposeschannel+eventsparamsNotes
notify listsection order is Twitch → YouTube → Animeshort/communityevent types still work via the website API but are not exposed as command choices