@plusplus karma automater
#!/usr/bin/env python | |
import os | |
import time | |
from slackclient import SlackClient | |
slack_token = os.environ["SLACK_API_TOKEN"] | |
sc = SlackClient(slack_token) | |
stuff = { | |
"<@U8Q1UCGPM>": 243, # This is the slack user id | |
"@whatever": 2, # Regular stuff also works | |
} | |
for what, karma in stuff.items(): | |
current = 0 | |
while current != karma: | |
print(" %s != %s" % (current, karma) ) | |
if karma > 0: | |
msg = "%s++ karmasync" % what | |
current += 1 | |
if karma < 0: | |
msg = "%s-- karmasync" % what | |
current -= 1 | |
print(msg) | |
# msg = "@platypus++" | |
sc.api_call( | |
"chat.postMessage", | |
as_user=True, | |
link_names=True, | |
username='svdgraaf', | |
parse='none', | |
channel="plusplus-sync", | |
text=msg | |
) | |
time.sleep(0.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment