1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00
royalnet/rpgpack/commands/dndinfo.py
2019-12-04 01:47:00 +01:00

18 lines
655 B
Python

from royalnet.commands import *
from ..tables import DndCharacter, DndActiveCharacter
class DndinfoCommand(Command):
name: str = "dndinfo"
description: str = "Display the character sheet of the active DnD character."
aliases = ["di", "dndi", "info", "dinfo"]
tables = {DndCharacter, DndActiveCharacter}
async def run(self, args: CommandArgs, data: CommandData) -> None:
author = await data.get_author(error_if_none=True)
if author.dnd_active_character is None:
raise CommandError("You don't have an active character.")
await data.reply(author.dnd_active_character.character.character_sheet())