[Help] Running help on an invalid command raises errors in DM with custom checks #4390

Closed
opened 2020-09-03 05:19:40 +02:00 by TrustyJAID · 3 comments
TrustyJAID commented 2020-09-03 05:19:40 +02:00 (Migrated from github.com)

Command bugs

Command name

[p]help

What cog is this command from?

Help formatter

What were you expecting to happen?

[p]help non_existant_command_or_group returns nothing

What actually happened?

[p]help non_existant_command_or_group raises an error unrelated to anything in particular

How can we reproduce this issue?

Run [p]help <some command that doesn't exist> in DM with the bot with custom build checks.

# Command bugs #### Command name `[p]help` #### What cog is this command from? Help formatter #### What were you expecting to happen? `[p]help non_existant_command_or_group` returns nothing #### What actually happened? `[p]help non_existant_command_or_group` raises an error unrelated to anything in particular #### How can we reproduce this issue? Run `[p]help <some command that doesn't exist>` in DM with the bot with custom build checks.
Jackenmen commented 2020-09-03 07:24:37 +02:00 (Migrated from github.com)

I can't reproduce this, I would need a bit more details than what's presented here. Output of [p]helpset showsettings as well as the traceback (and code related to it, if it's 3rd-party) could help here.

I can't reproduce this, I would need a bit more details than what's presented here. Output of `[p]helpset showsettings` as well as the traceback (and code related to it, if it's 3rd-party) could help here.
TrustyJAID commented 2020-09-03 07:31:52 +02:00 (Migrated from github.com)

I put this up because it happened on my public bot when I tested the issue posted in #coding in the Red Server. After making the issue I looked closer at the traceback and realized it was a mistake in a custom check I wrote to allow a certain command only in specific guilds with this decorator @commands.check(lambda ctx: ctx.guild.id in TEAM_SERVERS.values()). I can fix it by changing the check to first check if guild exists in the ctx @commands.check(lambda ctx: ctx.guild is not None and ctx.guild.id in TEAM_SERVERS.values()) I don't know if it's something we can really fix or needs to be fixed and I jumped the gun slightly on this issue.

I put this up because it happened on my public bot when I tested the issue posted in #coding in the Red Server. After making the issue I looked closer at the traceback and realized it was a mistake in a custom check I wrote to allow a certain command only in specific guilds with this decorator `@commands.check(lambda ctx: ctx.guild.id in TEAM_SERVERS.values())`. I can fix it by changing the check to first check if guild exists in the ctx `@commands.check(lambda ctx: ctx.guild is not None and ctx.guild.id in TEAM_SERVERS.values())` I don't know if it's something we can really fix or needs to be fixed and I jumped the gun slightly on this issue.
Jackenmen commented 2020-09-03 18:58:22 +02:00 (Migrated from github.com)

After additional conversation, it turned out that this is not really an issue with Red, but with some 3rd-party code, so I'm closing this.

After additional conversation, it turned out that this is not really an issue with Red, but with some 3rd-party code, so I'm closing this.
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#4390
No description provided.