📜  如何在 discord.py 中添加分页 - Python 代码示例

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

代码示例2
def check_react(reaction, user):
        if reaction.message.id != msg.id:
            return False
        if user != ctx.message.author:
            return False
        return True
    res, user = await bot.wait_for('reaction_add', check=check_react, timeout=None,)
    if user != ctx.message.author:
        print('if user != ctx.message.author:')
    elif '⬅️' in str(res.emoji):
        page -=1
        print(page)
        embed = discord.Embed(title='generic title', description='generic description', color=0x52fffc)
        await msg.edit(embed=embed)
    elif '➡️' in str(res.emoji):
        page +=1
        print(page)
        embed = discord.Embed(title='generic title 2', description='generic description 2', color=0x52fffc)
        await msg.edit(embed=embed)