Removed the interaction timeout from the poll view, and added a requirement for 2 options at least
This commit is contained in:
@@ -19,5 +19,5 @@ class Button(nextcord.ui.Button):
|
|||||||
|
|
||||||
class ButtonView(nextcord.ui.View):
|
class ButtonView(nextcord.ui.View):
|
||||||
def __init__(self, owner):
|
def __init__(self, owner):
|
||||||
super().__init__()
|
super().__init__(timeout=None)
|
||||||
self.add_item(Button(owner=owner))
|
self.add_item(Button(owner=owner))
|
||||||
4
run.py
4
run.py
@@ -182,7 +182,9 @@ async def on_message(message):
|
|||||||
letter = part[0].lower()
|
letter = part[0].lower()
|
||||||
else: # the part is an option
|
else: # the part is an option
|
||||||
poll.options[letter] = part
|
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")
|
await message.channel.send("Erreur : 20 options maximum")
|
||||||
else:
|
else:
|
||||||
output = f"{intro}\n\n"
|
output = f"{intro}\n\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user