From ab432efb13aec7ad50b7c717c1fca273fa29bc18 Mon Sep 17 00:00:00 2001 From: Simon Junod Date: Wed, 27 Apr 2022 17:57:19 +0200 Subject: [PATCH] Removed the interaction timeout from the poll view, and added a requirement for 2 options at least --- cambot/polls.py | 2 +- run.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cambot/polls.py b/cambot/polls.py index 0ba3ef3..cfbb4ae 100644 --- a/cambot/polls.py +++ b/cambot/polls.py @@ -19,5 +19,5 @@ class Button(nextcord.ui.Button): class ButtonView(nextcord.ui.View): def __init__(self, owner): - super().__init__() + super().__init__(timeout=None) self.add_item(Button(owner=owner)) \ No newline at end of file diff --git a/run.py b/run.py index 3b566d9..50067e1 100755 --- a/run.py +++ b/run.py @@ -182,7 +182,9 @@ async def on_message(message): letter = part[0].lower() else: # the part is an option poll.options[letter] = part - if len(poll.options) > 20: + if len(poll.options) < 2: + pass + elif len(poll.options) > 20: await message.channel.send("Erreur : 20 options maximum") else: output = f"{intro}\n\n"