Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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))
Source by discordpy.readthedocs.io #
 
PREVIOUS NEXT
Tagged: #bot #discord #py
ADD COMMENT
Topic
Name
6+8 =