Category Hierarchy

我正在尝试使用python (discord.py)做一个不协调的多项选择按钮/反应--类似于下图:

?

?

例如,当它对2??反应时,显示的是第2页;当它对3??反应时,显示的是第3页...有人能帮帮我吗?

import discord
from discord.ext import commands

class Wiki(commands.Cog):
    def __init__(self,bot):
        self.bot=bot

    #commands
    @commands.command(name="wiki",aliases=["w"])
    async def wiki(self,ctx):
        page1=discord.Embed(
        title='Page 1/3',
        description='Description1',
        colour=discord.Colour.orange()
        )
        page2=discord.Embed(
        title='Page 2/3',
        description='Description2',
        colour=discord.Colour.orange()
        )
        page3=discord.Embed(
        title='Page 3/3',
        description='Description3',
        colour=discord.Colour.orange()
        )
        pages=[page1,page2,page3]

        message= await ctx.send(embed=page1)

        await message.add_reaction('1??')
        await message.add_reaction('2??')
        await message.add_reaction('3??')
        
        emoji=""
        if emoji=="1??":
            await message.edit_message(message,embed=pages[0])
        if emoji=="2??":
            await message.edit_message(message,embed=pages[1])
        if emoji=="3??":
            await message.edit_message(message,embed=pages[2])       

def setup(bot):
    bot.add_cog(Wiki(bot))

转载请注明出处:http://www.biaocun.net/article/20230526/1501786.html