From 2d8dc471f5af362104f0094bd541044f55e332ce Mon Sep 17 00:00:00 2001 From: c0de Date: Thu, 10 Nov 2022 22:42:45 -0600 Subject: [PATCH] Add help manager --- GhostBallBot/game/help.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 GhostBallBot/game/help.py diff --git a/GhostBallBot/game/help.py b/GhostBallBot/game/help.py new file mode 100644 index 0000000..39ae807 --- /dev/null +++ b/GhostBallBot/game/help.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +# Copyright 2022 - c0de +# Licensed under the MIT License (https://opensource.org/licenses/MIT) + +# pylint: disable=missing-module-docstring + +from game.manager import BaseGameManager + +class HelpManager(BaseGameManager): + """Commands that run when a player asks for help""" + + def __init__(self): + self.commands.append(("help", self.help)) + super().__init__() + + async def help(self): + """help command - Sends a DM to the requesting user with available commands""" + + help_message = ( + "Braveball commands\n" + + "!braveball - Start new game\n" + + "!guess - While a game is running, add a guess" + + " (or update an existing one) from 1-1000\n" + + "!resolve - 1-1000 to resolve the game\n" + + " You can also add a batter's guess with: " + + "!resolve \n" + + "!points - Shows a table of the most recent players, and their scores\n" + + "!help - Shows this message" + ) + + recipient = await self.discord.fetch_user(self.message.author.id) + await recipient.send(help_message)