コード例 #1
0
ファイル: league.py プロジェクト: Snowcola/roosterbot
    async def game(self, ctx, person):
        """Shows the current game and who is in it"""
        try:
            player = Summoner(name=person, region="NA")
            match = player.current_match()
            gametype = match.queue
            blue_team = match.blue_team().participants
            red_team = match.red_team().participants
            duration = match.duration

            data = []
            data.append(["Red Team", "Blue Team"])

            for x in range(len(red_team)):
                data.append(
                    [red_team[x].summoner.name, blue_team[x].summoner.name])

            table = SingleTable(data)
            response = f""" Current Game:

            **{person} is {duration} into a {gametype.value} game**\n\n```{table.table}```"""

            await self.bot.send_message(ctx.message.channel, response)

        except ValueError as e:
            await self.bot.say(f"Something went wrong there :(")
            print(e)
コード例 #2
0
    async def display_game_pregame_summary(message: Message) -> None:
        summoner_name = re.compile("/pregamesummary (.*)").match(
            message.content).group(1)
        summoner = Summoner(name=summoner_name, region="NA")
        player_match_history = summoner.current_match()

        output = "```"
        output += "{:>18} {:>14} {:>14} {:>15}".format(
            "SUMMONER", "CHAMPION", "SOLO RANK", "FLEX RANK") + "\n"
        output += LeagueClientHelper.display_team_pregame_info(
            player_match_history.blue_team.participants)
        output += "----------------------------------------------------------------------------------\n"
        output += LeagueClientHelper.display_team_pregame_info(
            player_match_history.red_team.participants)

        output += "```"
        await message.channel.send(output)
        Logger.log('Outputting Game Summary for: {summoner_name}')