Start on supporting checking for online status of Twitch Teams #5972

Manually merged
palmtree5 merged 0 commits from palmtree5/V3/enhancement/streams_twitchteams into V3/develop 2026-11-21 16:09:39 +01:00
palmtree5 commented 2023-01-16 01:10:38 +01:00 (Migrated from github.com)

Description of the changes

Adds support for checking the online status of a Twitch Team (more specifically: it will display the team's info and generate online stream embeds for members of the team that are online, while NOT displaying the offline members). Resolves #2157 and I went with the option of minimizing the number of requests being made to Twitch's API (i.e. one request to get the team data, one request for every 100 team members' user data, one request for every 100 team members' stream data (which offline users do not show up in), and one request per user for their current follower count). This also makes a few changes to other classes, including implementing a TwitchMeta class, which is a subclass of Stream, but which has TwitchStream and TwitchTeam as subclasses (this is mainly to just put the handling of API calls for Twitch in one place), and changing make_embed in TwitchStream to be a staticmethod as it is the format I wanted for the online user embeds.

Note that the actual Discord command has not been written yet, but that's ultimately the easier part. I also need to have it generate the embed with the data for the team itself as that should be displayed every time.

Have the changes in this PR been tested?

Somewhat, as I definitely have it at the point of being able to list out online team members, but there are other pieces not written yet, hence the draft status for the moment

Yes
No

### Description of the changes Adds support for checking the online status of a Twitch Team (more specifically: it will display the team's info and generate online stream embeds for members of the team that are online, while NOT displaying the offline members). Resolves #2157 and I went with the option of minimizing the number of requests being made to Twitch's API (i.e. one request to get the team data, one request for every 100 team members' user data, one request for every 100 team members' stream data (which offline users do not show up in), and one request per user for their current follower count). This also makes a few changes to other classes, including implementing a `TwitchMeta` class, which is a subclass of `Stream`, but which has `TwitchStream` and `TwitchTeam` as subclasses (this is mainly to just put the handling of API calls for Twitch in one place), and changing `make_embed` in `TwitchStream` to be a `staticmethod` as it is the format I wanted for the online user embeds. Note that the actual Discord command has not been written yet, but that's ultimately the easier part. I also need to have it generate the embed with the data for the team itself as that should be displayed every time. ### Have the changes in this PR been tested? Somewhat, as I definitely have it at the point of being able to list out online team members, but there are other pieces not written yet, hence the draft status for the moment <!-- Choose one (remove the line that doesn't apply): --> Yes No <!-- If the question doesn't apply (for example, it's not a code change), choose Yes. Please respond to this question truthfully. We do not delay nor reject PRs based on the answer to this question but it allows to better review this PR. -->
palmtree5 commented 2023-02-20 05:31:53 +01:00 (Migrated from github.com)

Update on this: [p]twitchteam has been added in and has been confirmed working. The output from that command comes in the form of two messages: one for the team info, and a reaction menu for the team members currently online.

I am not sure if we want to pursue stream alerts for Twitch teams though as I am quite honestly not sure how I would want to proceed on that front

Update on this: `[p]twitchteam` has been added in and has been confirmed working. The output from that command comes in the form of two messages: one for the team info, and a reaction menu for the team members currently online. I am not sure if we want to pursue stream alerts for Twitch teams though as I am quite honestly not sure how I would want to proceed on that front
palmtree5 commented 2024-11-20 22:47:28 +01:00 (Migrated from github.com)

This PR should be ready to test. Will be holding off on trying to do any sort of stream alerts for Twitch Teams for the time being (I.e. that will be a separate PR if it gets written)

This PR should be ready to test. Will be holding off on trying to do any sort of stream alerts for Twitch Teams for the time being (I.e. that will be a separate PR if it gets written)
Mrcoolgamer11 manually merged commit 4e6c2889d5 into V3/develop 2026-11-21 16:09:39 +01:00
Owner

This PR was ported to the current codebase in 3979961c8 instead of being merged as-is:

Add [p]twitchteam to show which members of a Twitch team are live.
TwitchTeam now subclasses TwitchStream instead of introducing a separate base
class, and uses the current Twitch followers endpoint.

This PR was ported to the current codebase in 3979961c8 instead of being merged as-is: Add [p]twitchteam to show which members of a Twitch team are live. TwitchTeam now subclasses TwitchStream instead of introducing a separate base class, and uses the current Twitch followers endpoint.
Sign in to join this conversation.
No reviewers
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 milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot!5972
No description provided.