fetched = c.fetchall()
queue = [x[0] for x in fetched]
twitch = ttv_api.users.get_users(user_ids=queue)
+
if not twitch:
bot.send_privmsg(
message.channel,
reply=message.tags["id"],
)
+ c.execute(
+ """
+ SELECT twitch_id FROM lol_queue WHERE available = 0 ORDER BY position ASC;
+ """
+ )
+ fetched_unavailable = c.fetchall()
+ unavailable = [x[0] for x in fetched_unavailable]
+ twitch_unavailable = ttv_api.users.get_users(user_ids=unavailable)
+
+ unavailable_users = []
+ for twitch_id in unavailable:
+ for twitch_user in twitch_unavailable:
+ if int(twitch_user.user_id) == int(twitch_id):
+ unavailable_users.append(twitch_user.display_name)
+ break
+ else:
+ bot.send_privmsg(
+ message.channel,
+ f"There was an issue fetching data from the user with id {twitch_id}. They won't be in the list. This is a very weird problem to have occured. Sadge",
+ reply=message.tags["id"],
+ )
+
play_list = [user.display_name for user in queue_users[1:queue_size]]
prio_queue = []
wait_list = []
msg = f"These people are playing with {message.channel}: {play_list} | These people are in Priority Queue: {prio_queue} | These people are in the Wait List: {wait_list}."
else:
msg = f"These people are playing with {message.channel}: {play_list} | These people are in the Wait List: {wait_list}."
+
+ if unavailable_users:
+ msg += f" | These people are also not here: {unavailable_users}."
+
tools.smart_privmsg.send(
bot,
message,