前提
discord.pyでhelpコマンドを作ってます。
実現したいこと
リアクションしたら埋め込みメッセージを移動する
発生している問題・エラーメッセージ
補足情報 発生している問題 1ページから始まって2ページが飛ばされて3ページになり5ページまで行って全部戻すと2ページになります エラーメッセージはないです。
@bot.command() async def help(ctx): pages = 5 cur_page = 1 embed1 embed2 embed3 embed4 embed5 contents = [embed1, embed2, embed3, embed4, embed5] message = await ctx.send(embed=embed1) await message.add_reaction("◀️") await message.add_reaction("▶️") def check(reaction, user): return user == ctx.author and str(reaction.emoji) in ["◀️", "▶️"] while True: try: reaction, user = await bot.wait_for("reaction_add", timeout=500, check=check) if str(reaction.emoji) == "▶️" and cur_page != pages: cur_page += 1 await message.edit(embed=contents[cur_page + 0]) await message.remove_reaction(reaction, user) elif str(reaction.emoji) == "◀️" and cur_page > 1: cur_page -= 1 await message.edit(embed=contents[cur_page - 0]) await message.remove_reaction(reaction, user) else: await message.remove_reaction(reaction, user) except asyncio.TimeoutError: await message.delete() break ### 試したこと ### 補足情報(FW/ツールのバージョンなど) discord.py : 2.01 discord : 2.00

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。