Skip to content Skip to sidebar Skip to footer

Discord.py Get Message From Dm

I try to make my bot to get message from DM using this syntax: for wolf in wolf_list_id: poll_message = await self.client.get_message(wolf, react_message.id) The wolf contains

Solution 1:

like said the doc, the client.get_message methods must take as parameter an channel object and an id. In case of DM channel, you can pass an user or member object.

For get an user by id, you can use client.get_user_info methods:

user = await client.get_user_info("123456789")

And after, with your userobject, you can get message with ID

message = await client.get_message(user, "135792468")

So, for fix your code, if wolf is a string id, you can use this following code:

for wolf in wolf_list_id:
    user = await self.client.get_user_info(wolf)
    poll_message = await self.client.get_message(user, react_message.id)

Post a Comment for "Discord.py Get Message From Dm"