Skip to content
Advertisement

Check if the last 2 messages were sent by the same person in discord.py

I’d like to know if it’s possible to check if the last 2 messages in a channel (either the specific channel or the whole server, doesn’t really matter for my purpose) were sent by the same person in discord.py, e.g. something like this:

JavaScript

Thanks.

Advertisement

Answer

You can get the channel of the message, and then get the history:

JavaScript

Or, alternatively, if you want to check if all of the last n messages were sent by the same author:

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