diff options
author | 2021-11-04 16:08:03 -0400 | |
---|---|---|
committer | 2022-02-09 18:13:37 -0500 | |
commit | 4b999a506d1736d636d298b3316686014f4630fb (patch) | |
tree | c9cee215d619480f5f8b0fe0feebda698ce7a01f /bot | |
parent | change checkmark to white_check_mark (diff) |
better docstring for load
Diffstat (limited to 'bot')
-rw-r--r-- | bot/exts/events/trivianight/trivianight.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/bot/exts/events/trivianight/trivianight.py b/bot/exts/events/trivianight/trivianight.py index 46db8c74..96493f2f 100644 --- a/bot/exts/events/trivianight/trivianight.py +++ b/bot/exts/events/trivianight/trivianight.py @@ -45,7 +45,22 @@ class TriviaNight(commands.Cog): @trivianight.command() async def load(self, ctx: commands.Context, *, to_load: Optional[str]) -> None: - """Load the JSON file provided into the questions.""" + """ + Loads a JSON file from the provided attachment or argument. + + The JSON provided is formatted where it is a list of dictionaries, each dictionary containing the keys below: + - number: int (represents the current question #) + - description: str (represents the question itself) + - answers: list (represents the different answers possible, must be a length of 4) + - correct: str (represents the correct answer in terms of what the correct answer is in `answers` + - time: Optional[int] (represents the timer for the question and how long it should run, default is 10) + - points: Optional[int] (represents how many points are awarded for each question, default is 10) + + The load command accepts three different ways of loading in a JSON: + - an attachment of the JSON file + - a message link to the attachment/JSON + - reading the JSON itself via a codeblock or plain text + """ if ctx.message.attachments: json_text = (await ctx.message.attachments[0].read()).decode("utf8") elif to_load.startswith("https://discord.com/channels") or \ |