diff --git a/cogs/players.py b/cogs/players.py index 24986d7..b317801 100644 --- a/cogs/players.py +++ b/cogs/players.py @@ -1704,22 +1704,21 @@ class Players(commands.Cog): await ctx.send('Hmm...I can\'t find your team. Are you from around here?') return - s_query = await db_get('schedules', params=[ - ('season', current['season']), ('team_abbrev', this_team['abbrev']), ('week_start', current['week']), - ('week_end', current['week']), ('short_output', False) + g_query = await db_get('games', params=[ + ('season', current['season']), ('week', current['week']), ('team1_id', this_team['id']) ]) - if s_query['count'] == 0: + if g_query['count'] == 0: other_team = await get_other_team() if not other_team: await ctx.send(f'Idk who you are playing this week.') channel_name = f'{this_team["abbrev"]} vs {other_team["abbrev"]} Muted' else: - this_matchup = s_query['schedules'][0] - if this_team == this_matchup['awayteam']: - other_team = this_matchup['hometeam'] + this_game = g_query['games'][0] + if this_team == this_game['away_team']: + other_team = this_game['home_team'] else: - other_team = this_matchup['awayteam'] - channel_name = f'{this_matchup["awayteam"]["sname"]} @ {this_matchup["hometeam"]["sname"]} Muted' + other_team = this_game['away_team'] + channel_name = f'{this_game["away_team"]["sname"]} @ {this_game["home_team"]["sname"]} Muted' prompt = f'Would you like to get a private voice channel for {this_team["abbrev"]} and {other_team["abbrev"]}?' this_q = Question(self.bot, ctx.channel, prompt, qtype='yesno', timeout=15)