Custom commands with Parameters not working #6145

Closed
opened 2023-05-11 23:48:32 +02:00 by scarecr0w12 · 3 comments
scarecr0w12 commented 2023-05-11 23:48:32 +02:00 (Migrated from github.com)

What Red version are you using?

3.5.1

Cog name

Customcom

Command name

+greet @scarecr0w12

What did you expect to happen?

Bot should utilize the custom command of greet which requires a Mentioned user.

When you input:
+greet <mention user>

it should output:
Hello, <Mentioned user>

What actually happened?

No output from discord bot, however the error is logged in the log files:

[2023-05-11 21:36:15] [ERROR] discord.client: Ignoring exception in on_message_without_command
Traceback (most recent call last):
  File "/root/redenv/lib/python3.11/site-packages/discord/client.py", line 441, in _run_event
    await coro(*args, **kwargs)
  File "/root/redenv/lib/python3.11/site-packages/redbot/cogs/customcom/customcom.py", line 679, in on_message_without_command
    await self.bot.invoke(ctx)
  File "/root/redenv/lib/python3.11/site-packages/discord/ext/commands/bot.py", line 1350, in invoke
    await ctx.command.invoke(ctx)
  File "/root/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 1015, in invoke
    await self.prepare(ctx)
  File "/root/redenv/lib/python3.11/site-packages/redbot/core/commands/commands.py", line 482, in prepare
    await self._parse_arguments(ctx)
  File "/root/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 847, in _parse_arguments
    kwargs[name] = await self.transform(ctx, param, attachments)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 647, in transform
    converter = param.converter
                ^^^^^^^^^^^^^^^
AttributeError: 'Parameter' object has no attribute 'converter'

How can we reproduce this error?

  1. Create custom command using +cc create simple greet Hello, {0.mention:Member}!
  2. User custom command by using +greet <Mention user>

Anything else?

No response

### What Red version are you using? 3.5.1 ### Cog name Customcom ### Command name +greet @scarecr0w12 ### What did you expect to happen? Bot should utilize the custom command of `greet` which requires a Mentioned user. When you input: `+greet <mention user>` it should output: `Hello, <Mentioned user>` ### What actually happened? No output from discord bot, however the error is logged in the log files: ``` [2023-05-11 21:36:15] [ERROR] discord.client: Ignoring exception in on_message_without_command Traceback (most recent call last): File "/root/redenv/lib/python3.11/site-packages/discord/client.py", line 441, in _run_event await coro(*args, **kwargs) File "/root/redenv/lib/python3.11/site-packages/redbot/cogs/customcom/customcom.py", line 679, in on_message_without_command await self.bot.invoke(ctx) File "/root/redenv/lib/python3.11/site-packages/discord/ext/commands/bot.py", line 1350, in invoke await ctx.command.invoke(ctx) File "/root/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 1015, in invoke await self.prepare(ctx) File "/root/redenv/lib/python3.11/site-packages/redbot/core/commands/commands.py", line 482, in prepare await self._parse_arguments(ctx) File "/root/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 847, in _parse_arguments kwargs[name] = await self.transform(ctx, param, attachments) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 647, in transform converter = param.converter ^^^^^^^^^^^^^^^ AttributeError: 'Parameter' object has no attribute 'converter' ``` ### How can we reproduce this error? 1. Create custom command using `+cc create simple greet Hello, {0.mention:Member}!` 2. User custom command by using `+greet <Mention user>` ### Anything else? _No response_
Flame442 commented 2023-05-11 23:51:14 +02:00 (Migrated from github.com)

I think this is a duplicate of #6138.

I think this is a duplicate of #6138.
scarecr0w12 commented 2023-05-11 23:53:31 +02:00 (Migrated from github.com)

Most likely, I didn't know if all parameters were treated equally with this cog.

Most likely, I didn't know if all parameters were treated equally with this cog.
Flame442 commented 2023-05-11 23:55:42 +02:00 (Migrated from github.com)

Considering the error is the same, and the only difference is the addition of typehints and attribute fetching (which is an expansion of the features used in the other report), I'm going to close this as a duplicate. Fixing that issue is currently planned for 3.5.2, so hopefully there will be a fix soon!

Considering the error is the same, and the only difference is the addition of typehints and attribute fetching (which is an expansion of the features used in the other report), I'm going to close this as a duplicate. Fixing that issue is currently planned for 3.5.2, so hopefully there will be a fix soon!
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#6145
No description provided.