"""Contains the StarWarsCog, which deals with Star Wars commands.""" from discord.ext import commands from discord_slash import cog_ext from utils import getParams # pylint: disable=import-error params = getParams() class StarWarsCog(commands.Cog): """Contains the Star Wars commands.""" def __init__(self, bot): """Initialize the cog.""" self.bot = bot @cog_ext.cog_slash(**params["starWarsRoll"]) async def starWarsRoll(self, ctx, dice=""): """Roll Star Wars dice.""" await self.bot.starWars.roll.parseRoll(ctx, dice) @cog_ext.cog_slash(**params["starWarsDestiny"]) async def starWarsDestiny(self, ctx, parameters=""): """Control Star Wars destiny points.""" await self.bot.starWars.destiny.parseDestiny(ctx, parameters) @cog_ext.cog_slash(**params["starWarsCrit"]) async def starWarsCrit(self, ctx, severity: int = 0): """Roll for critical injuries.""" await self.bot.starWars.roll.critRoll(ctx, severity) @cog_ext.cog_slash(**params["starWarsCharacter"]) async def starWarsCharacter(self, ctx, parameters=""): """Access and change Star Wars character sheet data.""" await self.bot.starWars.character.parseChar(ctx, parameters) def setup(bot): """Add the cog to the bot.""" bot.add_cog(StarWarsCog(bot))