Skip to content

Commit 861e68e

Browse files
committed
fix crash on poll tie
1 parent 702305b commit 861e68e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

protobot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ async def count_poll_results(message_sent, poll_time_in_sec):
402402
tie = True
403403

404404
# If there's a tie, find out which results tied and make a string out of them, then print results
405+
winner_percentage = round((results[winner] / total_votes) * 100, 2)
405406
if tie:
406407
tied_emojis = []
407408
tie_string = ""
@@ -420,7 +421,6 @@ async def count_poll_results(message_sent, poll_time_in_sec):
420421

421422
# Otherwise, show winner
422423
else:
423-
winner_percentage = round((results[winner] / total_votes) * 100, 2)
424424
await message_sent.channel.send(f"Voting for \"{prompt}\" complete. {winner} is the winner with {results[winner]} ({winner_percentage}%) votes!")
425425

426426
await count_poll_results(message_sent, poll_time_in_sec)

0 commit comments

Comments
 (0)