football.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Pancake-Cogs 作者: UltimatePancake 项目源码 文件源码
def _matchdayfixtures(self, ctx: commands.Context, league_id: str, matchday: str='1'):
        """Gets specific matchday fixtures

        Defaults to matchday 1"""
        headers = ['ID', 'Home', ' ', ' ', 'Away']
        data = await self._get_league_fixtures_matchday(ctx.message.server.id, league_id, matchday)

        await self.bot.say('```diff\n+ Matchday ' + matchday + ' fixtures```')
        pretty_data = []
        for fixture in data['fixtures']:
            pretty_data.append([
                fixture['id'],
                '[{}] {}'.format(fixture['homeTeamId'], fixture['homeTeamName']),
                fixture['result']['goalsHomeTeam'],
                fixture['result']['goalsAwayTeam'],
                '[{}] {}'.format(fixture['awayTeamId'], fixture['awayTeamName'])
            ])

        await self.bot.say(box(tabulate(pretty_data, headers=headers)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号