Pincer icon indicating copy to clipboard operation
Pincer copied to clipboard

:bug: `message.channel.send` is broken within `on_message`

Open Sigmanificient opened this issue 4 years ago • 1 comments

Describe the bug

message.channel.send is broken within on_message

Steps to Reproduce

@Client.event
    async def on_message(self, message: UserMessage):
        await message.channel.send("Hello world")

Relevant console output

Traceback (most recent call last):
  File "/home/sigmanificient/dev/pincer/bot/pincer_bot/cogs/info.py", line 125, in on_message
    await message.channel.send(Embed(description=f"[{content}]({url})"))
  File "/home/sigmanificient/dev/pincer/bot/venv/lib/python3.10/site-packages/pincer/utils/api_object.py", line 323, in channel
    return self._client.channels[self.channel_id]
KeyError: 881534044431609886

Pincer Version used

0.15.1

Sigmanificient avatar Jan 06 '22 20:01 Sigmanificient

This will be fixed when I finish implementing caching

Enderchief avatar Jan 06 '22 20:01 Enderchief

Closed due to depreciation, thank you for your effort ♥

Arthurdw avatar Dec 26 '22 13:12 Arthurdw