Skip to content
Open
Show file tree
Hide file tree
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
10 changes: 3 additions & 7 deletions techsupport_bot/commands/voting.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ async def register_vote(
# Check if voter is allowed to vote
vote_ids_eligible = db_entry.vote_ids_eligible.split(",")
if user_id not in vote_ids_eligible:
await interaction.response.send_message(
await interaction.followup.send(
"You are not eligible to vote here.", ephemeral=True
)
return
Expand All @@ -511,9 +511,7 @@ async def register_vote(
vote_ids = getattr(db_entry, vote_config["ids_field"]).split(",")

if user_id in vote_ids:
await interaction.response.send_message(
vote_config["already_msg"], ephemeral=True
)
await interaction.followup.send(vote_config["already_msg"], ephemeral=True)
return

# Remove user from any previous vote
Expand Down Expand Up @@ -548,9 +546,7 @@ async def register_vote(
embed = await self.build_vote_embed(db_entry.vote_id, interaction.guild)
await interaction.message.edit(embed=embed, view=view)

await interaction.response.send_message(
vote_config["success_msg"], ephemeral=True
)
await interaction.followup.send(vote_config["success_msg"], ephemeral=True)

async def clear_vote(
self: Self,
Expand Down
4 changes: 4 additions & 0 deletions techsupport_bot/ui/persistent_voting.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ async def yes_button(
interaction (discord.Interaction): The interaction created when the button was pressed
button (discord.ui.Button): The button object itself
"""
await interaction.response.defer(ephemeral=True)
cog = interaction.client.get_cog("Voting")
await cog.register_vote(interaction, self, "yes")

Expand All @@ -48,6 +49,7 @@ async def no_button(
interaction (discord.Interaction): The interaction created when the button was pressed
button (discord.ui.Button): The button object itself
"""
await interaction.response.defer(ephemeral=True)
cog = interaction.client.get_cog("Voting")
await cog.register_vote(interaction, self, "no")

Expand All @@ -67,6 +69,7 @@ async def abstain_button(
interaction (discord.Interaction): The interaction created when the button was pressed
button (discord.ui.Button): The button object itself
"""
await interaction.response.defer(ephemeral=True)
cog = interaction.client.get_cog("Voting")
await cog.register_vote(interaction, self, "abstain")

Expand All @@ -86,5 +89,6 @@ async def clear_button(
interaction (discord.Interaction): The interaction created when the button was pressed
button (discord.ui.Button): The button object itself
"""
await interaction.response.defer(ephemeral=True)
cog = interaction.client.get_cog("Voting")
await cog.clear_vote(interaction, self)
Loading