[Core] Add [p]set mentionhelp command to the bot #3914
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 milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!3914
Loading…
Reference in a new issue
No description provided.
Delete branch "fixes-3912"
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
fixes #3912
I don't think we should be adding such event to the bot. IMO, it would be better to just do all the necessary checks in newly added
on_message_without_commandevent listener.And they should definitely happen after checking the
mentionhelpsetting is enabled.yeah the checks after is a good point.
The event, the reason for an early exit here, is i dont want the
message_without_commanddispatched if this mention this setting is enabled, and the checks all pass.This is to reduce the risk of cogs also doing things on this signal.
For example, cleverbot cog, it replies if you just use @botMention the bot will also reply, and with this on it would send 2 messages. but using a separate event that is dispatched earlier, and stop
on_message_without_commandbeing dispatched this wont be the case.This is exactly something that IMO we should NOT be doing.
Personally i feel that if this is enable it should take priority over other cogs.
As a bot owner if i enabled this behaviour for a single mention i wouldnt other cogs to mess up with it.
But input from the community here could be useful.
and example is a user goes and run @botMention
With my proposal if the setting is enable it would show the prefixes and not send a
on_message_without_commandevent.With what jack is suggesting we could send the dispatch for that event which means cogs that listen to that event and single mention would also respond.
So for example, cleverbot would also respond to the mention sending 2 messages to the user, the prefixes, and the clever bot message.
not dispatching
message_without_commandwould definitely break people using that event.Personally, I find any bot that responds to just a plain mention to be a malfunction at best, mentions aren't obviously commands and could very easily just be an easy way to reference a bot in conversation knowing that bots don't get annoyed at pings.
To that end, I'm not sure why this isn't just a 3rd party cog rather than another setting that has to be checked on every non-command message even for people not using this.
Even if this is to be included though, changing that event behavior would be problematic.
Just a note so that i dont forget .. this is wrong.
I feel like this strongly impacts performance and should not be added to core at all sadly enough.
This
ifblock seems like an extreme drain in performance considering how much stuff it has to check. Theon_messageevent is already a hotly contested. Before the commands are processed i18n will have to run, context is being generated, and finally this if block will have to go through its steps. This all adds time before command execution for something which has a very low chance of occurring in a live situation.https://github.com/Cog-Creators/Red-DiscordBot/pull/3914/files#diff-b4e8893536462f5cd5d7e291288c4d5eR908-R920
A good way to look at this is to ask your self, how many times am I gonna mention the bot for its prefix. And from what I've seen, the use case of where the bot acts as the primary moderation bot for an extremely scaled server. This is nearly never gonna occur.
Simply put, this adds too much time between execution to be beneficial at all when the bot is under constant stress already.
I've gone ahead and created this as an additional cog to demonstrate a correct implementation of this which does not require making a listener which cannot be removed by people who do not want this behavior heavier for it. Given the simplicity of it, I have no issue keeping this in the repo long term, and anyone should be able to trivially modify it.
Given how easy this is to add on without being in core, I hope this is enough reason to not make core's
on_messagehandling heavier.The aforementioned cog looks good to me.
Closing this in favour of it.
Pull request closed