-
Hi! One of the functions my bot has are reminders - a user can set a message to send from the bot at specified time. The message is sent to the channel, where the user message with the bot command has been sent (or DM, if the reminder was set via DM with bot). This works well if the target message is sent to a channel on any guild. However, when trying to send a DM via bot, it only works sometimes. What's strange, I'm pretty sure it used to work reliably all the time a few months ago, but it doesn't anymore (?). I might have overlooked any relevant commits to the repo or closed issued in the bug tracker, but didn't find any. I'm trying to get the destination channel via From I could gather, I think that I'm at a loss. Is there something I need to set up before sending a DM to a user? What am I doing wrong? It's especially confusing since it used to work. Here's the code if it's at all important. Sorry in advance, I know it's not something to be proud of. :P |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The intended way of getting the DM between the client and a user is The docs for |
Beta Was this translation helpful? Give feedback.
The intended way of getting the DM between the client and a user is
client.get_user(USER_ID).dm_channel
. A DM's channel ID is not the same as one of the user's IDs.The docs for
User.dm_channel
explains its return type and what to do if it returnsNone
.