From: Georgios Atheridis Date: Wed, 11 May 2022 00:37:54 +0000 (+0000) Subject: fixed a bug for teams X-Git-Url: https://git.atheridis.org/?a=commitdiff_plain;h=2831a4487ec14e5cfa4eb444145d01476d126526;p=ihaspeks%2Faptbot-ihaspeks.git fixed a bug for teams --- diff --git a/skgyorugo/commands/teams.py b/skgyorugo/commands/teams.py index b0f3848..fc90363 100644 --- a/skgyorugo/commands/teams.py +++ b/skgyorugo/commands/teams.py @@ -51,6 +51,15 @@ def main(bot: Bot, message: Message): ) users = [x[0] for x in fetched] + if not users: + bot.send_privmsg( + message.channel, + "No teams have been set yet.", + reply=message.tags["id"], + ) + conn.close() + return + twitch = ttv_api.users.get_users(user_ids=users) if not twitch: bot.send_privmsg( @@ -65,7 +74,7 @@ def main(bot: Bot, message: Message): for twitch_user in twitch: if int(twitch_user.user_id) in blue_team: blue_team_users.append(twitch_user.display_name) - elif int( twitch_user.user_id ) in red_team: + elif int(twitch_user.user_id) in red_team: red_team_users.append(twitch_user.display_name) else: bot.send_privmsg(