📜  bot wait_for discord py - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:11.634000             🧑  作者: Mango

代码示例1
@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))