paper-dynasty-discord/cogs/economy/help_system.py
2025-08-17 08:46:55 -05:00

242 lines
9.1 KiB
Python

# Economy Help System Module
# Contains all help and FAQ commands from the original economy.py
import logging
from discord.ext import commands
from discord import app_commands
import discord
# Import specific utilities needed by this module
from api_calls import db_get
from help_text import (
HELP_START_WHAT, HELP_START_HOW, HELP_START_PLAY, HELP_REWARDS_PREMIUM,
HELP_REWARDS_STANDARD, HELP_REWARDS_MONEY, HELP_REWARDS_SHOP, HELP_TS_DASH,
HELP_TS_ROSTER, HELP_TS_MARKET, HELP_TS_MENU, HELP_GAMEMODES, HELP_NEWGAME,
HELP_PLAYGAME, HELP_ENDGAME
)
from helpers.constants import IMAGES, PD_PLAYERS
from helpers import legal_channel, get_channel, get_roster_sheet
from helpers.discord_utils import get_team_embed
logger = logging.getLogger('discord_app')
class HelpSystem(commands.Cog):
"""Help and FAQ system for Paper Dynasty commands."""
def __init__(self, bot):
self.bot = bot
@commands.hybrid_group(name='help-pd', help='FAQ for Paper Dynasty and the bot', aliases=['helppd'])
@commands.check(legal_channel)
async def pd_help_command(self, ctx: commands.Context):
if ctx.invoked_subcommand is None:
embed = get_team_embed(f'Paper Dynasty Help')
embed.description = 'Frequently Asked Questions'
embed.add_field(
name='What the Heck is Paper Dynasty',
value=f'Well, whipper snapper, have a seat and I\'ll tell you. We\'re running a diamond dynasty / '
f'perfect team style game with electronic card and dice baseball!\n\nGet a starter pack, play '
f'games at your leisure either solo or against another player, and collect cards from the '
f'custom 2021 player set.',
inline=False
)
embed.add_field(
name='How Do I Get Started',
value=f'Run the `.in` command - that\'s a period followed by the word "in". That\'ll get you the '
f'Paper Dynasty Players role so you can run all of the other PD commands!\n\nOnce you get your '
f'role, run `/newteam` and follow the prompts to get your starter team.',
inline=False
)
embed.add_field(
name='How Do I Play',
value='A step-by-step of how to play was written by Riles [starting here](https://discord.com/channels'
'/613880856032968834/633456305830625303/985968300272001054). '
'In addition, you can find the Rules Reference [right here](https://docs.google.com/document/d/'
'1yGZcHy9zN2MUi4hnce12dAzlFpIApbn7zR24vCkPl1o).\n\nThere are three key differences from league '
'play:\n1) Injuries: there are no injuries in Paper Dynasty!\n2) sWAR: there is no sWAR "salary '
'cap" for your team like in league play. Some events will have roster construction rules to '
'follow, though!\n3) The Universal DH is in effect; teams may forfeit the DH at their '
'discretion.',
inline=False
)
await ctx.send(
content=None,
embed=embed
)
@pd_help_command.command(name='start', help='FAQ for Paper Dynasty and the bot', aliases=['faq'])
@commands.check(legal_channel)
async def help_faq(self, ctx: commands.Context):
embed = get_team_embed(f'Paper Dynasty Help')
embed.description = 'Frequently Asked Questions'
embed.add_field(
name='What the Heck is Paper Dynasty',
value=HELP_START_WHAT,
inline=False
)
embed.add_field(
name='How Do I Get Started',
value=HELP_START_HOW,
inline=False
)
embed.add_field(
name='How Do I Play',
value=HELP_START_PLAY,
inline=False
)
embed.add_field(
name='Other Questions?',
value=f'Feel free to ask any questions down in {get_channel(ctx, "paper-dynasty-chat")} or check out '
f'the other `/help-pd` commands for the FAQs!'
)
await ctx.send(
content=None,
embed=embed
)
@pd_help_command.command(name='links', help='Helpful links for Paper Dynasty')
@commands.check(legal_channel)
async def help_links(self, ctx: commands.Context):
current = await db_get('current')
embed = get_team_embed(f'Paper Dynasty Help')
embed.description = 'Resources & Links'
embed.add_field(
name='Team Sheet Template',
value=f'{get_roster_sheet({"gsheet": current["gsheet_template"]})}'
)
embed.add_field(
name='Paper Dynasty Guidelines',
value='https://docs.google.com/document/d/1ngsjbz8wYv7heSiPMJ21oKPa6JLStTsw6wNdLDnt-k4/edit?usp=sharing',
inline=False
)
embed.add_field(
name='Rules Reference',
value='https://docs.google.com/document/d/1wu63XSgfQE2wadiegWaaDda11QvqkN0liRurKm0vcTs/edit?usp=sharing',
inline=False
)
await ctx.send(content=None, embed=embed)
@pd_help_command.command(name='rewards', help='How to Earn Rewards in Paper Dynasty')
@commands.check(legal_channel)
async def help_rewards(self, ctx: commands.Context):
embed = get_team_embed(f'Paper Dynasty Help')
embed.description = 'How to Earn Rewards'
embed.add_field(
name='Premium Pack',
value=HELP_REWARDS_PREMIUM,
inline=False
)
embed.add_field(
name='Standard Pack',
value=HELP_REWARDS_STANDARD,
inline=False
)
embed.add_field(
name='MantiBucks ₼',
value=HELP_REWARDS_MONEY,
inline=False
)
embed.add_field(
name='Ko-fi Shop',
value=HELP_REWARDS_SHOP,
inline=False
)
await ctx.send(content=None, embed=embed)
@pd_help_command.command(name='team-sheet', help='How to Use Your Team Sheet')
@commands.check(legal_channel)
async def help_team_sheet(self, ctx: commands.Context):
embed = get_team_embed(f'Paper Dynasty Help')
embed.description = 'How to Use Your Team Sheet'
embed.add_field(
name='Your Dashboard',
value=HELP_TS_DASH,
inline=False
)
embed.add_field(
name='Roster Management',
value=HELP_TS_ROSTER,
inline=False
)
embed.add_field(
name='Marketplace',
value=HELP_TS_MARKET,
inline=False
)
embed.add_field(
name='Paper Dynasty Menu',
value=HELP_TS_MENU,
inline=False
)
embed.set_footer(
text='More details to come',
icon_url=IMAGES['logo']
)
await ctx.send(content=None, embed=embed)
@pd_help_command.command(name='gameplay', help='How to Play Paper Dynasty')
@commands.check(legal_channel)
async def help_gameplay(self, ctx: commands.Context):
embed = get_team_embed(f'Paper Dynasty Help')
embed.description = 'How to Play Paper Dynasty'
embed.add_field(
name='Game Modes',
value=HELP_GAMEMODES,
inline=False
)
embed.add_field(
name='Start a New Game',
value=HELP_NEWGAME,
inline=False,
)
embed.add_field(
name='Playing the Game',
value=HELP_PLAYGAME,
inline=False
)
embed.add_field(
name='Ending the Game',
value=f'{HELP_ENDGAME}\n'
f'- Go post highlights in {get_channel(ctx, "pd-news-ticker").mention}',
inline=False
)
await ctx.send(content=None, embed=embed)
@pd_help_command.command(name='cardsets', help='Show Cardset Requirements')
@commands.check(legal_channel)
async def help_cardsets(self, ctx: commands.Context):
embed = get_team_embed(f'Paper Dynasty Help')
embed.description = 'Cardset Requirements'
embed.add_field(
name='Ranked Legal',
value='2024 Season + Promos, 2018 Season + Promos',
inline=False
)
embed.add_field(
name='Minor League',
value='Humans: Unlimited\nAI: 2024 Season / 2018 Season as backup',
inline=False
)
embed.add_field(
name='Major League',
value='Humans: Ranked Legal\nAI: 2024, 2018, 2016, 2008 Seasons / 2023 & 2022 as backup',
inline=False
)
embed.add_field(
name='Flashback',
value='2016, 2013, 2012, 2008 Seasons',
inline=False
)
embed.add_field(
name='Hall of Fame',
value='Humans: Ranked Legal\nAI: Unlimited',
inline=False
)
await ctx.send(content=None, embed=embed)
async def setup(bot):
"""Setup function for the HelpSystem cog."""
await bot.add_cog(HelpSystem(bot))