pycord icon indicating copy to clipboard operation
pycord copied to clipboard

Message Converter error with non-cached messages

Open LilJess13 opened this issue 5 years ago • 0 comments

Summary

Getting ChannelNotFound error when trying to convert to a message with an ID from a non-cached message

Reproduction Steps

Get the id of a message that was before the last bot restart so it doesnt pull from cache Run a command with a discord.Message typehint

Minimal Reproducible Code

@bot.command()
async def test(ctx, message: discord.Message):
    await ctx.send(f"{message.author} - {message.content}")

Expected Results

For it to convert the ID to a message object

Actual Results

Traceback (most recent call last):
  File "C:\Users\Jesse\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 994, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\Jesse\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 886, in invoke
    await self.prepare(ctx)
  File "C:\Users\Jesse\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 820, in prepare
    await self._parse_arguments(ctx)
  File "C:\Users\Jesse\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 726, in _parse_arguments
    transformed = await self.transform(ctx, param)
  File "C:\Users\Jesse\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 578, in transform
    return await run_converters(ctx, converter, argument, param)  # type: ignore
  File "C:\Users\Jesse\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\converter.py", line 1182, in run_converters
    return await _actual_conversion(ctx, converter, argument, param)
  File "C:\Users\Jesse\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\converter.py", line 1076, in _actual_conversion
    return await converter().convert(ctx, argument)
  File "C:\Users\Jesse\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\converter.py", line 395, in convert
    raise ChannelNotFound(channel_id)
discord.ext.commands.errors.ChannelNotFound: Channel "None" not found.

Intents

all()

System Information

Python 3.9 Pycord 2.0.0a

Checklist

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

Additional Context

No response

LilJess13 avatar Sep 12 '21 09:09 LilJess13