79532109

Date: 2025-03-24 20:48:34
Score: 0.5
Natty:
Report link

Answer was to change send to send_message and to import time so I can use delta time for the duration of the poll

Fixed Code:

import time 
import datetime

@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=datetime.timedelta(hours=4))
    p.add_answer(text="Yes")
    p.add_answer(text="No")
    
    await interaction.response.send_message(poll=p)
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Gankick