Skip to content

Commit

Permalink
Updated poll texts
Browse files Browse the repository at this point in the history
  • Loading branch information
Martian-0007 committed Jul 27, 2023
1 parent 3958343 commit 1904c99
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 6 deletions.
24 changes: 18 additions & 6 deletions cogs/poll_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async def transform(
msg = f"Zadal jsi příliš mnoho odpovědí, můžeš maximálně {Poll.MAX_OPTIONS}!"
raise TooManyOptionsError(msg, interaction)
if len(answers) < Poll.MIN_OPTIONS:
msg = f"Zadal jsi příliš málo odpovědí, můžeš alespoň {Poll.MIN_OPTIONS}!"
msg = f"Zadal jsi příliš málo odpovědí, zadej alespoň {Poll.MIN_OPTIONS}!"
raise TooFewOptionsError(msg, interaction)
return answers

Expand All @@ -64,22 +64,34 @@ async def transform(self, interaction: discord.Interaction, date_time: str) -> d


class PollCreate(commands.Cog):
POLL_PARAMETERS = {
"name": "anketa",
"description": "Anketa pro hlasování. Jsou vidět všichni, kteří se zapojili.",
"question": "Otázka, na kterou potřebuješ znát odpověď",
"answers": f'Odpovědi, odpovědi rozděluj uvozovkami ("), maximálně až {Poll.MAX_OPTIONS} možností',
"date_time": "Datum, kdy anketa skončí",
"help":
f"""
Jednoduchá anketa, která obsahuje otázku a odpovědi. Povoleno je až {Poll.MAX_OPTIONS} možností.
"""
}

def __init__(self, bot: Jachym):
self.bot = bot

@app_commands.command(
name="anketa",
description="Anketa pro hlasování. Jsou vidět všichni hlasovatelé.",
name=POLL_PARAMETERS["name"],
description=POLL_PARAMETERS["description"],
)
@app_commands.rename(
question="otázka",
answer="odpovědi",
date_time="datum",
)
@app_commands.describe(
question="Otázka, kterou chceš položit.",
answer='Odpovědi, rozděluješ odpovědi uvozovkou ("), maximálně pouze 10 možností',
date_time="Den, na který anketa skončí.",
question=POLL_PARAMETERS["question"],
answer=POLL_PARAMETERS["answers"],
date_time=POLL_PARAMETERS["date_time"],
)
async def pool(
self,
Expand Down
4 changes: 4 additions & 0 deletions src/UNKNOWN.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Metadata-Version: 2.1
Name: UNKNOWN
Version: 0.0.0
License-File: LICENSE
19 changes: 19 additions & 0 deletions src/UNKNOWN.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
LICENSE
pyproject.toml
src/__init__.py
src/helpers.py
src/jachym.py
src/UNKNOWN.egg-info/PKG-INFO
src/UNKNOWN.egg-info/SOURCES.txt
src/UNKNOWN.egg-info/dependency_links.txt
src/UNKNOWN.egg-info/top_level.txt
src/db_folder/databases.py
src/ui/__init__.py
src/ui/button.py
src/ui/embeds.py
src/ui/emojis.py
src/ui/error_view.py
src/ui/modals.py
src/ui/poll.py
src/ui/poll_view.py
tests/test_pool.py
1 change: 1 addition & 0 deletions src/UNKNOWN.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

6 changes: 6 additions & 0 deletions src/UNKNOWN.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
__init__
db_folder
helpers
jachym
text_json
ui

0 comments on commit 1904c99

Please sign in to comment.