2022-11-11 04:42:45 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# Copyright 2022 - c0de <c0de@c0de.dev>
|
|
|
|
# Licensed under the MIT License (https://opensource.org/licenses/MIT)
|
|
|
|
|
2022-12-10 04:30:36 +00:00
|
|
|
# pylint: disable=missing-module-docstring,too-few-public-methods
|
2022-11-11 04:42:45 +00:00
|
|
|
|
2022-11-12 02:06:14 +00:00
|
|
|
from game.base import BaseGameManager
|
2022-11-11 04:42:45 +00:00
|
|
|
|
2022-11-11 04:44:24 +00:00
|
|
|
|
2022-11-11 04:42:45 +00:00
|
|
|
class HelpManager(BaseGameManager):
|
|
|
|
"""Commands that run when a player asks for help"""
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__()
|
2022-11-11 18:52:54 +00:00
|
|
|
self.commands.append(("help", self.help))
|
2022-11-11 04:42:45 +00:00
|
|
|
|
|
|
|
async def help(self):
|
|
|
|
"""help command - Sends a DM to the requesting user with available commands"""
|
|
|
|
|
|
|
|
help_message = (
|
|
|
|
"Braveball commands\n"
|
2022-11-12 05:55:15 +00:00
|
|
|
+ "ping - Will respond 'pong' if the bot is alive\n"
|
2022-11-11 04:42:45 +00:00
|
|
|
+ "!braveball - Start new game\n"
|
|
|
|
+ "!guess - While a game is running, add a guess"
|
|
|
|
+ " (or update an existing one) from 1-1000\n"
|
|
|
|
+ "!resolve <value> - 1-1000 to resolve the game\n"
|
2024-04-23 22:19:20 +00:00
|
|
|
+ "!clear - Clear the session scoreboard\n"
|
2022-11-11 04:42:45 +00:00
|
|
|
+ "!points - Shows a table of the most recent players, and their scores\n"
|
2024-04-23 22:19:20 +00:00
|
|
|
+ "!reset - Removes all players and total points\n"
|
2022-11-11 04:42:45 +00:00
|
|
|
+ "!help - Shows this message"
|
|
|
|
)
|
|
|
|
|
|
|
|
recipient = await self.discord.fetch_user(self.message.author.id)
|
|
|
|
await recipient.send(help_message)
|