这是使用 discord.py 2.0 alpha SelectMenu
。编辑原始消息后,选择清除了编辑后如何保留选择的任何想法?
我认为应该这样做,但我无法在代码中实现:
play_status_view()
的变量class play_status_view(discord.ui.View):
def __init__(self):
super().__init__(timeout=None)
@discord.ui.select(custom_id="squad_play_status", placeholder="Signup status",
min_values=1, max_values=1,
options=[discord.SelectOption(label="A"),
discord.SelectOption(label="B"),
discord.SelectOption(label="C")])
async def signup_callback(self, select: discord.ui.select, interaction: discord.Interaction):
print(select.values[0])
await interaction.response.edit_message(embed=discord.Embed(title='Test'))
# or
await interaction.response.edit_message(embed=discord.Embed(title='Test'), view=self)