From 95060ed142aa9086235e8934782a8f62b28fb961 Mon Sep 17 00:00:00 2001 From: dnns01 <mail@dnns01.de> Date: Mon, 7 Dec 2020 21:38:01 +0100 Subject: [PATCH] fix $125 - Allow up to 18 possible answers for a poll => cap of reactions that can get added to a message --- poll_cog.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/poll_cog.py b/poll_cog.py index da003f5..7895c22 100644 --- a/poll_cog.py +++ b/poll_cog.py @@ -3,8 +3,7 @@ import os import discord from discord.ext import commands -OPTIONS = ["\u0031\u20E3", "\u0032\u20E3", "\u0033\u20E3", "\u0034\u20E3", "\u0035\u20E3", "\u0036\u20E3", - "\u0037\u20E3", "\u0038\u20E3", "\u0039\u20E3", "\u0040\u20E3"] +OPTIONS = ["🇦", "🇧", "🇨", "🇩", "🇪", "🇫", "🇬", "🇭", "🇮", "🇯", "🇰", "🇱", "🇲", "🇳", "🇴", "🇵", "🇶", "🇷"] class PollCog(commands.Cog): @@ -69,9 +68,9 @@ class Poll: if result: title += " Ergebnis" - if len(self.answers) > 10: + if len(self.answers) > len(OPTIONS): await channel.send( - "Fehler beim Erstellen der Umfrage! Es werden derzeit nicht mehr als 10 Optionen unterstützt!") + f"Fehler beim Erstellen der Umfrage! Es werden nicht mehr als {len(OPTIONS)} Optionen unterstützt!") return embed = discord.Embed(title=title, description=self.question) @@ -83,7 +82,7 @@ class Poll: value = f'{self.answers[i]}' if result: - reaction = self.get_reaction(OPTIONS[i]) + reaction = self.get_reaction(name) if reaction: name += f' : {reaction.count - 1}' # value += f'\nStimmen: ' -- GitLab