Ejemplo n.º 1
0
    async def _do_execute(self, cmd: Command):
        league = LeagueMgr().league
        if league is None:
            await cmd.channel.send(
                'Error: The current event (`{0}`) does not exist.'.format(Config.LEAGUE_NAME)
            )
            return

        league.name = cmd.arg_string
        league.commit()

        await cmd.channel.send(
            'Set the name of current CoNDOR event (`{0}`) to {1}.'.format(league.schema_name, league.name)
        )
Ejemplo n.º 2
0
    async def _do_execute(self, cmd: Command):
        league = LeagueMgr().league
        if league is None:
            await cmd.channel.send(
                'Error: The current event (`{0}`) does not exist.'.format(Config.LEAGUE_NAME)
            )
            return

        try:
            match_info = matchinfo.parse_args(cmd.args)
        except necrobot.exception.ParseException as e:
            await cmd.channel.send(
                'Error parsing inputs: {0}'.format(e)
            )
            return

        league.match_info = match_info
        league.commit()
        await cmd.channel.send(
            'Set the default match rules for `{0}` to {1}.'.format(league.schema_name, match_info.format_str)
        )
Ejemplo n.º 3
0
    async def _do_execute(self, cmd: Command):
        league = LeagueMgr().league
        if league is None:
            await self.client.send_message(
                cmd.channel,
                'Error: The current event (`{0}`) does not exist.'.format(Config.LEAGUE_NAME)
            )
            return

        try:
            match_info = matchinfo.parse_args(cmd.args)
        except necrobot.exception.ParseException as e:
            await self.client.send_message(cmd.channel, e)
            return

        match_info.race_info.condor_race = True
        league.match_info = match_info
        league.commit()
        await self.client.send_message(
            cmd.channel,
            'Set the default match rules for `{0}` to {1}.'.format(league.schema_name, match_info.format_str)
        )