Skip to content

Interaction channel is PartialMessageable when channel data is available #3046

@ariflan159

Description

@ariflan159

Summary

Commands with user install integration type don't have full channel data in interaction.channel

Reproduction Steps

  • Create a command with user install integration type
  • Try to access any data about the channel in which the command was ran
  • Run this command in a guild without the bot

Minimal Reproducible Code

@bot.slash_command(integration_types={discord.IntegrationType.user_install})
async def get_channel_name(ctx:discord.ApplicationContext):
    await ctx.respond(ctx.channel.name)

Expected Results

Bot responds to the command with the channel name

Actual Results

Bot raises an error: AttributeError: 'PartialMessageable' object has no attribute 'name'

Intents

Intents.all()

System Information

- Python v3.13.5-final
- py-cord v2.7.None-final
- aiohttp v3.13.2
- system info: Linux 6.12.57+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.57-1 (2025-11-05)

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

Traceback

Traceback (most recent call last):

File ".../lib/python3.13/site-packages/discord/commands/core.py", line 138, in wrapped
ret = await coro(arg)
^^^^^^^^^^^^^^^

File ".../lib/python3.13/site-packages/discord/commands/core.py", line 1108, in _invoke
await self.callback(ctx, **kwargs)

File ".../main.py", line 28, in get_channel_name
await ctx.respond(ctx.channel.name, ephemeral=True)
^^^^^^^^^^^^^^^^

AttributeError: 'PartialMessageable' object has no attribute 'name'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File ".../lib/python3.13/site-packages/discord/bot.py", line 1154, in invoke_application_command
await ctx.command.invoke(ctx)

File ".../lib/python3.13/site-packages/discord/commands/core.py", line 435, in invoke
await injected(ctx)

File ".../lib/python3.13/site-packages/discord/commands/core.py", line 146, in wrapped
raise ApplicationCommandInvokeError(exc) from exc

discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'PartialMessageable' object has no attribute 'name'

Notes

This worked in 2.6.1, and rolling back to that version does solve the problem. I believe that the issue was introduced in this commit

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority: mediumMedium Priority

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions