Skip to content
Snippets Groups Projects
Unverified Commit 1ca91603 authored by SaelDE's avatar SaelDE Committed by GitHub
Browse files

Update hausgeist.py

-added percentages to output
parent c3bf27c3
Branches
No related tags found
No related merge requests found
......@@ -124,11 +124,16 @@ async def event_message(ctx):
print('Not enough votes: {}'.format(len(votes)))
else:
get_votes()
output = '/me Plus: {} + Neutral: {} - Minus: {} ' \
'Endergebnis nach {} Sekunden ohne neuen Vote. '.format(plus,
neutral,
minus,
VOTE_DELAY_END)
output = '/me Plus: {} ({}%) + Neutral: {} ({}%) - Minus: {} ({}%) ' \
'Endergebnis nach {} Sekunden ohne neuen Vote.' \
' '.format(plus,
int(plus / len(votes) * 100),
neutral,
int(neutral / len(votes) * 100),
minus,
100-int(plus / len(votes) * 100)-int(neutral / len(votes) * 100),
VOTE_DELAY_END)
# spammer_top = max(spammer, key=spammer.get)
# if spammer[spammer_top] >= 10:
# output = output + '@{} ({}) hör auf zu spammen!'.format(spammer_top,
......@@ -153,11 +158,16 @@ async def event_message(ctx):
else:
vote_first = time.time()
get_votes()
output = '/me Plus: {} + Neutral: {} - Minus: {} ' \
'Zwischenergebnis nach {} Sekunden durchgängige Votes. '.format(plus,
neutral,
minus,
VOTE_DELAY_INTERIM)
output = '/me Plus: {} ({}%) + Neutral: {} ({}%) - Minus: {} ({}%) ' \
'Zwischenergebnis nach {} Sekunden durchgängige Votes.' \
' '.format(plus,
int(plus / len(votes) * 100),
neutral,
int(neutral / len(votes) * 100),
minus,
100-int(plus / len(votes) * 100)-int(neutral / len(votes) * 100),
VOTE_DELAY_INTERIM)
await ctx.channel.send(output)
print('Sending: {}'.format(output))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment