Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python discord bot wait for response

# Use Client.wait_for to wait for on_message event.

@commands.command()
async def greet(ctx):
    await ctx.send("Say hello!")

    def check(m):
        return m.content == "hello" and m.channel == channel

    msg = await bot.wait_for("message", check=check)
    await ctx.send(f"Hello {msg.author}!")
Comment

bot wait_for discord py

@client.event
async def on_message(message):
    if message.content.startswith('$greet'):
        channel = message.channel
        await channel.send('Say hello!')

        def check(m):
            return m.content == 'hello' and m.channel == channel

        msg = await client.wait_for('message', check=check)
        await channel.send('Hello {.author}!'.format(msg))
Comment

PREVIOUS NEXT
Code Example
Python :: pandas decimal places 
Python :: Right click context menu of a file in Python 
Python :: python primera letra mayuscula 
Python :: python run another python script 
Python :: generate random prime number python 
Python :: date format in django template 
Python :: how to create virtual environment 
Python :: backup django db from one database to another 
Python :: python catch all exceptions 
Python :: sheebang python 
Python :: rename coordinate netcdf python xarray 
Python :: python os is directory 
Python :: df select first n rows 
Python :: load all csv files in a folder python pandas 
Python :: Replace empty string and "records with only spaces" with npnan pandas 
Python :: print all values of dictionary 
Python :: lru cache python 
Python :: Jupyter notebook: let a user inputs a drawing 
Python :: how to set the size of a gui in python 
Python :: python expression factorisation 
Python :: row names pandas 
Python :: django clear db 
Python :: pandas rename column name 
Python :: python image black and white 
Python :: random permutation python 
Python :: how to get chat first name in telebot 
Python :: logout in discord.py 
Python :: filter function using lambda in python 
Python :: rabbitmq pika username password 
Python :: Remove the Unnamed column in pandas 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =