""" Handlers for the RPG commands. """ import guilds from guilds import guilds_instance from . import rpg_instance from command_parser import CommandParser import time parser = CommandParser("?") parser.add_custom_context( "player", lambda ctx: rpg_instance.fetchplayer(ctx.user.id, ctx.user.name)) @parser.command(aliases="h", help_text="show this help message") async def help(ctx): response = "**Commands:**\n" for command in parser.commands: help_text = parser.get_command_help(command) if help_text is not None: response += "\n" + help_text await ctx.send(response) """ SPAM COOLDOWN TRACKER - user id keys, time.time() values """ cooldowns = {}
color = webcolors.name_to_hex(color_string, spec='css3')[1:] return color except: try: color = color_string[1:] test = webcolors.hex_to_rgb("#" + color) return color except: return False """ GUILD MODULE COMMANDS """ parser = CommandParser("!") parser.add_custom_context( "guild", lambda ctx: guilds_instance.fetch_guild(ctx.message.guild.id)) @parser.command(aliases="h", help_text="show this help message") async def help(ctx): response = "**Commands:**\n" for command in parser.commands: help_text = parser.get_command_help(command) if help_text is not None: response += "\n" + help_text await ctx.send(response) @parser.command(help_text="shows the guild's parties") async def parties(ctx): #lists the guild's parties