diff --git a/main.py b/main.py index d98f9f9..53f0628 100644 --- a/main.py +++ b/main.py @@ -733,11 +733,15 @@ async def process_generate_report(select, interaction): guild = interaction.guild for recruit in select.values: cur.execute( - "SELECT recruits.nickname, count(yes_votes.id), count(no_votes.id) FROM recruits LEFT JOIN no_votes ON recruits.discord_id = no_votes.discord_id_recruit LEFT JOIN yes_votes ON recruits.discord_id = yes_votes.discord_id_recruit WHERE recruits.discord_id = ?", + "SELECT recruits.nickname FROM recruits WHERE recruits.discord_id = ?", (recruit,)) data = cur.fetchone() - description = description + "**" + str(data[0]) + ":** " + str(data[1]) + " Ja | " + str(data[2]) + "Nein -> \n" - if data[1] != 0: + cur.execute("SELECT count(*) FROM yes_votes WHERE discord_id_recruit = ?", (recruit, )) + yes_count = cur.fetchone()[0] + cur.execute("SELECT count(*) FROM no_votes WHERE discord_id_recruit = ?", (recruit, )) + no_count = cur.fetchone()[0] + description = description + "**" + str(data[0]) + ":** " + str(yes_count) + " Ja | " + str(no_count) + " Nein -> \n" + if no_count != 0: cur.execute("SELECT discord_id_voter, reason FROM no_votes WHERE discord_id_recruit = ?", (recruit,)) no_votes = cur.fetchall() for vote in no_votes: