Skip to content
Advertisement

Get all messages sent by a specific user in a channel/server – Discord.py

I’m trying to figure out a way to get all messages sent by a specific user in a channel and/or the whole server (would probably take a while for that).

I have also looked into User.history() and Member.history(), but despite the documentation not mentioning it, it will only return a User’s DM history.

Here is the Bot Command code snippet:

JavaScript

I’ve tried this answer, however, the check=check throws: an exception: TypeError: history() got an unexpected keyword argument 'check' ,although it does look like the cleanest solution.

Advertisement

Answer

That answer appears to be wrong, there is no such way to build checks into history. Also, if you want all the messages by that user, you would need to remove the limit. You could, however, try one of these:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement