Event wait for a specified message

Question:

I’m trying to create an event in a command that will wait for a specified user but it didn’t work :

await bot.wait_for('message', check=check("282859044593598464"))
if message.author.id == "282859044593598464":

I want to specify what the message contains.

Asked By: SIDALonpy

||

Answers:

Use

def check(message):
   return message.author.id == 282859044593598464

await bot.wait_for('message', check=check)

Then if you want to make more checks, just change the code in the function, and make it so that it return True if it is what you want (for example specific content) and False if it isn’t.
For example:

def check(message):
   return message.author.id == 282859044593598464 and message.content=="Here your text"
Answered By: Clement Genninasca
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.