Fix poll buttons text

This commit is contained in:
AlberLC
2023-09-29 00:46:02 +02:00
parent 61e60fc312
commit a154653e9a

View File

@@ -82,7 +82,7 @@ class PollBot(MultiBot, ABC):
for option, option_votes in poll_data['votes'].items(): for option, option_votes in poll_data['votes'].items():
ratio = f'{len(option_votes)}/{total_votes}' ratio = f'{len(option_votes)}/{total_votes}'
names = f"({', '.join(option_vote[1] for option_vote in option_votes)})" if option_votes else '' names = f"({', '.join(option_vote[1] for option_vote in option_votes)})" if option_votes else ''
buttons.append(f'{option}{ratio} {names}') buttons.append(f"{option}{ratio}{f' {names}' if names else ''}")
else: else:
buttons = list(poll_data['votes'].keys()) buttons = list(poll_data['votes'].keys())