📜  discord python 等待用户输入 - Python 代码示例

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

代码示例1
await ctx.send(f'Role {role.mention} was set as default role. Do you want to apply this to all users in the server? [YES/NO]')
    def check(m):
        return m.channel == ctx.channel
    msg = await bot.wait_for('message', check=check, timeout=500)
    checkcontinue = msg.content.lower()
    if checkcontinue == 'yes':
      await ctx.send(f'Assigning roles... This could take a little while!')