-
I'm currently trying to make a chat bot users can message in dms: async def send_response(self, message: MyMessage):
"""Send a response back to the Discord channel"""
if not self.bot:
return
# Get the channel
channel = self.bot.get_channel(int(message.channel)) # This returns `None`
if channel: # Consequently. this fails
await channel.send(message.content) I've made extra sure that the CHANNEL_ID ( the one you can copy with Now I'm under the impression that I'm either doing something wrong or the get_channel function isn't working properly. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Discord Channel objects don't support |
Beta Was this translation helpful? Give feedback.
DMs are only available on a LRU cache of 128 channels because Discord does not actually recommend keeping track of these long term. This is documented and warned pretty sure. You can also just use
Client.get_partial_messageable
to avoid an API call if you know the channel ID is valid.