Removed the interaction timeout from the poll view, and added a requirement for 2 options at least

This commit is contained in:
2022-04-27 17:57:19 +02:00
parent f7ae423a91
commit ab432efb13
2 changed files with 4 additions and 2 deletions

View File

@@ -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))

4
run.py
View File

@@ -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"