📜  discord pycord 在子类视图中添加 URL 按钮 - Python 代码示例

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

代码示例1
class helpView(View):
  def __init__(self):
    super().__init__(timeout=None)

    supportServerButton = discord.ui.Button(label='Support Server', style=discord.ButtonStyle.gray, url='https://discord.com')
    self.add_item(supportServerButton)

  @discord.ui.button(label='Commands', style=discord.ButtonStyle.green)
  async def command_callback(self, button, interaction):
    await interaction.response.edit_message(embed=commandEmbed, view=commandView())