Add allowed_mentions and mention everyone check to stream alerts #4182
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!4182
Loading…
Reference in a new issue
No description provided.
Delete branch "patch-1"
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?
Allows role mentions for discord.py 1.4+
Type
Description of the changes
Referencing line
747in commit. Gives permissions to mention role on stream announcement.While this PR solves the issue with mentions not actually pinging, do you think you could also make this not edit the roles if bot has mention everyone perms (as that perm now also allows to ping non-mentionable roles)?
Lines for reference:
[750-754]:[772-776]:Hopefully, this is what you had in mind? Humbly admit I may not have a business in biting this piece but looking forward to feedback on the best methodology for the wanted outcome. Sorry for the redraws on simple mistakes...
Thanks!
The added changes make the bot mention all roles in the guild, which is not the same behavior as there was before.
This can also be simplified a lot, I sent the review comments which should make it clear what should be done here.
This can all be removed if you apply my other suggestion.
@ -760,9 +768,10 @@ class Streams(commands.Cog):if await settings.mention_here():mentions.append("@here")This can be all removed if you apply my other suggestion.
This is all that needs to be done here:
It would be better if this were checking for permissions in channel:
This requires you to also add a
channelargument to this function and pass it in the place where it's called.committed suggestions and added channel iteration for
can_mention_everyonegithub.com/kablekompany/Red-DiscordBot@8eb21913bb/redbot/cogs/streams/streams.py (L767)As I said before, you need to add
channelparam to_get_mention_str()method so that the bot checks the permission for the channel it will send the message in. Iterating through all channels here doesn't make much sense - we only care about permissions in that specific channel the message will be sent in.understood. param added, iteration removed
Looks alright now, there's just one thing left - it looks like you forgot to pass the channel argument to
_get_mention_str()call in line 716.big time appreciate your patience and guidance @jack1142
Looks good to me, and thanks so much for including new functionality related to Mention Everyone perm as well ❤️