[Python] discord.py - making a slash command send a premade poll

Discussão em 'Python' iniciado por Stack, Março 24, 2025.

  1. Stack

    Stack Membro Participativo

    I am extremely new to this (started experimenting with it today) and am trying to make a slash command that will create a poll using a poll class i found in documentation but can't figure out how to get it to actually send.

    @client.tree.command(name="repo", description="Create a poll to see who's free for REPO", guild=GUILD_ID)
    async def repo(interaction: discord.Interaction):

    p = discord.Poll(question="Are you free for REPO?", duration=4)
    p.add_answer(text="Yes")
    p.add_answer(text="No")

    await interaction.response.send(poll=p)

    # /REPO command


    This is what I have atm and the await line is where it points the issue to.

    Continue reading...

Compartilhe esta Página