Beispiel #1
0
    async def _do_execute(self, cmd):
        try:
            cmd_idx = cmd.args.index('-repeat')
            repeat_index = int(cmd.args[cmd_idx + 1])
            del cmd.args[cmd_idx + 1]
            del cmd.args[cmd_idx]
        except (ValueError, IndexError):
            repeat_index = 1

        author_as_member = server.get_as_member(cmd.author)     # TODO convert to NecroUser

        repeat_index = min(20, max(repeat_index, 1))

        private_race_info = privateraceinfo.parse_args(cmd.args)
        if private_race_info is not None:
            for _ in range(repeat_index):
                await privateraceroom.make_private_room(private_race_info, author_as_member)
        else:
            await cmd.channel.send(
                cmd.channel, 'Error parsing arguments to `.makeprivate`.')
Beispiel #2
0
    async def _do_execute(self, cmd):
        try:
            cmd_idx = cmd.args.index('-repeat')
            repeat_index = int(cmd.args[cmd_idx + 1])
            del cmd.args[cmd_idx + 1]
            del cmd.args[cmd_idx]
        except (ValueError, IndexError):
            repeat_index = 1

        repeat_index = min(20, max(repeat_index, 1))

        private_race_info = privateraceinfo.parse_args(cmd.args)
        private_race_info.race_info.can_be_solo = False
        private_race_info.race_info.post_results = True
        private_race_info.race_info.condor_race = True
        if private_race_info is not None:
            for _ in range(repeat_index):
                await privateraceroom.make_private_room(private_race_info, cmd.author)
        else:
            await cmd.channel.send(
                cmd.channel, 'Error parsing arguments to `.makecondor`.')