Closed AstreaTSS closed 4 months ago
This PR finally adds support for Discord Polls to interactions.py.
poll
send
Message
N/A
from interactions import slash_command, SlashContext, Poll, PollMedia @slash_command() async def test(ctx: SlashContext): # method 1 poll = Poll.create("Test?", duration=1) poll.add_answer("Yes!") poll.add_answer("No.") # method 2 poll = Poll.create("Test?", duration=1).add_answer("Yes!").add_answer("No.") # method 3 poll = Poll.create("Test?", duration=1, answers=["Yes!", "No."]) # method 4 (mostly for emojis) poll = Poll.create("Test?", duration=1, answers=[PollMedia.create(text="Yes!"), PollMedia.create(text="No.")]) await ctx.send(poll=poll)
3.10.x
3.11.x
pre-commit
Pull Request Type
Description
This PR finally adds support for Discord Polls to interactions.py.
Changes
poll
parameter to the varioussend
s.poll
toMessage
.Related Issues
N/A
Test Scenarios
Python Compatibility
3.10.x
3.11.x
Checklist
pre-commit
code linter over all edited files