Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ButtonPoll] Fix Selects by responding to the interaction #95

Merged
merged 1 commit into from
Apr 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions buttonpoll/components/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ async def interaction_check(self, interaction: Interaction) -> bool:
)
async def btn_vote_change(self, interaction: discord.Interaction, select: discord.ui.Select):
self.vote_change = select.values[0] == "yes"
await interaction.response.defer()

@discord.ui.select(
placeholder="View results while live",
Expand All @@ -218,6 +219,7 @@ async def btn_view_while_live(
self, interaction: discord.Interaction, select: discord.ui.Select
):
self.view_while_live = select.values[0] == "yes"
await interaction.response.defer()

@discord.ui.select(
placeholder="Send message when poll is over",
Expand All @@ -236,6 +238,7 @@ async def btn_send_msg_when_over(
self, interaction: discord.Interaction, select: discord.ui.Select
):
self.send_msg_when_over = select.values[0] == "Send new"
await interaction.response.defer()

@discord.ui.button(label="Submit & start poll!", style=ButtonStyle.primary)
async def btn_submit(self, interaction: discord.Interaction, button: discord.ui.Button):
Expand Down