Skip to content

Message Command errors #342

Closed
Closed
@TropicalShadow

Description

@TropicalShadow

Summary

bot.message_command throws errors

Reproduction Steps

run the example code app_commands/message_command.py

replace token with your token, and then run.

Minimal Reproducible Code

import discord

bot = discord.Bot()

# user commands and message commands can have spaces in their names
@bot.message_command(name="Show ID")  # creates a global message command
async def show_id(ctx, message: discord.Message):  # message commands return the message
    await ctx.respond(f"{ctx.author.name}, here's the message id: {message.id}!")


bot.run("TOKEN")

Expected Results

It works...

Actual Results

Ignoring exception in on_connect
Traceback (most recent call last):
File "c:\Users\TropicalShadow\Documents\Coding\Python\Dependecies\pycord\discord\client.py", line 352, in _run_event
await coro(*args, **kwargs)
File "c:\Users\TropicalShadow\Documents\Coding\Python\Dependecies\pycord\discord\bot.py", line 555, in on_connect
await self.register_commands()
File "c:\Users\TropicalShadow\Documents\Coding\Python\Dependecies\pycord\discord\bot.py", line 197, in register_commands
global_permissions.append({"id": i["id"], "permissions": cmd.permissions})
AttributeError: 'NoneType' object has no attribute 'permissions'

Intents

non

System Information

  • Python v3.9.1-final
  • py-cord v2.0.0-alpha
    • py-cord pkg_resources: v2.0.0a4188+g9496c724
  • aiohttp v3.7.4.post0
  • system info: Linux 4.19.0-17-amd64 Update README.rst #1 SMP Debian 4.19.194-3 (2021-07-18)

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    unconfirmed bugA bug report that needs triaging

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions