Make [p]streamalert list show platform, allow to pass target channel to [p]streamalert commands #4151

Closed
douglascdev wants to merge 9 commits from 3866-streamalert into V3/develop
douglascdev commented 2020-08-03 03:11:04 +02:00 (Migrated from github.com)

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

Fixes #3866

  • Added argument to specify the discord channel where stream alerts appear
  • Stream alert list shows the platform the channels were added on(twitch or youtube)
### Type - [ ] Bugfix - [X] Enhancement - [ ] New feature ### Description of the changes Fixes #3866 - Added argument to specify the discord channel where stream alerts appear - Stream alert list shows the platform the channels were added on(twitch or youtube)
palmtree5 (Migrated from github.com) reviewed 2020-08-03 03:11:04 +02:00
Twentysix26 (Migrated from github.com) reviewed 2020-08-03 03:11:04 +02:00
Drapersniper (Migrated from github.com) reviewed 2020-08-03 03:11:04 +02:00
palmtree5 (Migrated from github.com) requested changes 2020-08-03 06:27:16 +02:00
palmtree5 (Migrated from github.com) commented 2020-08-03 06:27:11 +02:00

if you change all instances of discord_channel: str to discord_channel: discord.TextChannel, it becomes unnecessary to use regex to get the channel object as you will already have the channel object. I would also make sure all supported streaming services can have a discord channel specified (at the moment, Hitbox and Picarto seem to be excluded on this)

if you change all instances of `discord_channel: str` to `discord_channel: discord.TextChannel`, it becomes unnecessary to use regex to get the channel object as you will already have the channel object. I would also make sure all supported streaming services can have a discord channel specified (at the moment, Hitbox and Picarto seem to be excluded on this)
Drapersniper (Migrated from github.com) reviewed 2020-08-03 09:08:05 +02:00
Drapersniper (Migrated from github.com) commented 2020-08-03 09:08:05 +02:00

You should be using redbot.core.utils.chat_formating.humanize_list() here.

You should be using redbot.core.utils.chat_formating.humanize_list() here.
douglascdev (Migrated from github.com) reviewed 2020-08-04 02:23:26 +02:00
douglascdev (Migrated from github.com) commented 2020-08-04 02:23:25 +02:00

Got it, thank you, I've made the changes you asked for. After implementing the change for Picarto and Hitbox, I saw that I couldn't use token_name as platform name because theirs are initialized as None, so I made an attribute in the Stream class to hold the platform name. Is that and my other changes all right?

Got it, thank you, I've made the changes you asked for. After implementing the change for Picarto and Hitbox, I saw that I couldn't use token_name as platform name because theirs are initialized as None, so I made an attribute in the Stream class to hold the platform name. Is that and my other changes all right?
douglascdev (Migrated from github.com) reviewed 2020-08-04 02:25:54 +02:00
douglascdev (Migrated from github.com) commented 2020-08-04 02:25:54 +02:00

Thank you, I made the changes. I also split the platform and streams concatenation to msg into two different lines, which I believe is more readable. Let me know if there is anything else :)

Thank you, I made the changes. I also split the platform and streams concatenation to msg into two different lines, which I believe is more readable. Let me know if there is anything else :)
Jackenmen (Migrated from github.com) requested changes 2020-09-21 15:00:01 +02:00
Jackenmen (Migrated from github.com) left a comment

Looks pretty good, just needs some small polishing 👍
It looks like the repository with the base branch has been removed, so you most likely will need to recreate the branch from this PR's head and make a new PR. If you need a hand with that, you can ping me in #advanced-coding channel on Discord.

Looks pretty good, just needs some small polishing 👍 It looks like the repository with the base branch has been removed, so you most likely will need to recreate the branch from this PR's head and make a new PR. If you need a hand with that, you can ping me in `#advanced-coding` channel on Discord.
@ -300,3 +308,3 @@
return
await self.stream_alert(ctx, TwitchStream, channel_name.lower())
await self.stream_alert(ctx, TwitchStream, channel_name.lower(), discord_channel)
Jackenmen (Migrated from github.com) commented 2020-09-21 14:35:01 +02:00

discord_channel should have a default of None here same as other commands.

        self, ctx: commands.Context, channel_name: str, discord_channel: discord.TextChannel = None
`discord_channel` should have a default of `None` here same as other commands. ```suggestion self, ctx: commands.Context, channel_name: str, discord_channel: discord.TextChannel = None ```
@ -424,3 +444,4 @@
await self.add_or_remove(ctx, stream, discord_channel)
@commands.group()
@checks.mod_or_permissions(manage_channels=True)
Jackenmen (Migrated from github.com) commented 2020-09-21 14:48:00 +02:00

(this comment is optional) You could use nested defaultdict for streams_list instead and then not have to use .setdefault() on it later on:

        streams_list = defaultdict(lambda: defaultdict(list))
(this comment is optional) You could use nested defaultdict for `streams_list` instead and then not have to use `.setdefault()` on it later on: ```suggestion streams_list = defaultdict(lambda: defaultdict(list)) ```
Jackenmen (Migrated from github.com) commented 2020-09-21 14:52:02 +02:00

Channel mention would look better here. I also re-ordered the channel mention and "channel" word.

                    "I'll now send a notification in the {channel.mention} channel"
                    " when {stream.name} is live."
Channel mention would look better here. I also re-ordered the channel mention and "channel" word. ```suggestion "I'll now send a notification in the {channel.mention} channel" " when {stream.name} is live." ```
Jackenmen (Migrated from github.com) commented 2020-09-21 14:53:51 +02:00

Channel mention would look better here. I also added a dot at the end and re-ordered the channel mention and "channel" word in the code suggestion.

	                    "I won't send notifications about {stream.name}"
                        " in the {channel.mention} channel anymore."
Channel mention would look better here. I also added a dot at the end and re-ordered the channel mention and "channel" word in the code suggestion. ```suggestion "I won't send notifications about {stream.name}" " in the {channel.mention} channel anymore." ```
Jackenmen (Migrated from github.com) commented 2020-09-21 14:42:51 +02:00

YouTube uses a different casing for its name:

    platform_name = "YouTube"
YouTube uses a different casing for its name: ```suggestion platform_name = "YouTube" ```
Jackenmen (Migrated from github.com) commented 2020-09-21 14:43:50 +02:00

The platform is now called Smashcast and the class is named HitboxStream for backwards compatibility.

    platform_name = "Smashcast"
The platform is now called Smashcast and the class is named `HitboxStream` for backwards compatibility. ```suggestion platform_name = "Smashcast" ```
Jackenmen commented 2020-12-25 20:51:08 +01:00 (Migrated from github.com)

@douglas-cpp Hi, if you still want to handle this, let me know.
I'll be making a PR based on your contribution otherwise, as it would be wasteful if we haven't used it :)
All credit for your work will, of course, be retained - you will be a co-author on the new PR and the list of contributors for the relevant release will include you so you don't have to worry about that.

@douglas-cpp Hi, if you still want to handle this, let me know. I'll be making a PR based on your contribution otherwise, as it would be wasteful if we haven't used it :) All credit for your work will, of course, be retained - you will be a co-author on the new PR and the list of contributors for the relevant release will include you so you don't have to worry about that.
Jackenmen commented 2021-06-25 03:40:45 +02:00 (Migrated from github.com)

Superseded by #5160

Superseded by #5160

Pull request closed

Sign in to join this conversation.
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
1 participant
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!4151
No description provided.