aboutsummaryrefslogtreecommitdiffstats
path: root/SmallYTChannelBotSubmissions.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten@yahoo.co.uk>2019-01-01 12:27:10 +0000
committerjwansek <eddie.atten@yahoo.co.uk>2019-01-01 12:27:10 +0000
commitbebe783ec55d789b11343a621acc9c89df91a673 (patch)
treee3487030c42b42de41ee52471faba89a295e114c /SmallYTChannelBotSubmissions.py
parentc9d4e6b9b9a53d3fd7fdb038b380b663ec2aaba7 (diff)
downloadSmallYTChannelBot-bebe783ec55d789b11343a621acc9c89df91a673.tar.gz
SmallYTChannelBot-bebe783ec55d789b11343a621acc9c89df91a673.zip
added mod removal lambda
Diffstat (limited to 'SmallYTChannelBotSubmissions.py')
-rw-r--r--SmallYTChannelBotSubmissions.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/SmallYTChannelBotSubmissions.py b/SmallYTChannelBotSubmissions.py
index 38dd49a..fa8f209 100644
--- a/SmallYTChannelBotSubmissions.py
+++ b/SmallYTChannelBotSubmissions.py
@@ -125,7 +125,6 @@ def every_day():
db.update_stats()
_update_tables(db.get_scores(), db.get_stats())
-
def main():
tail = "\n\n\n ^/u/SmallYTChannelBot ^*made* ^*by* ^/u/jwnskanzkwk. ^*PM* ^*for* ^*bug* ^*reports.* ^*For* ^*more* ^*information,* ^*read* ^*the* ^[FAQ.](https://www.reddit.com/user/SmallYTChannelBot/comments/a4u7qj/smallytchannelbot_faq/)"
@@ -196,6 +195,24 @@ def main():
update_users_flair(comment.parent())
reply = comment.reply(text + tail)
reply.mod.distinguish()
+
+ if comment.body[:11] == "!takelambda" and str(comment.author) in get_mods():
+ try:
+ splitted = comment.body.split()
+ user = splitted[1].replace("/u/", "")
+ toremove = int(splitted[2])
+ reason = " ".join(splitted[3:])
+
+ text = "/u/%s has had %iλ taken away from them for the reason '%s'. /u/%s now has %iλ" % (user, toremove, reason, user, db.get_lambda(user)[0] - toremove)
+ db.change_lambda(user, -toremove)
+ except Exception as e:
+ print("[ERROR while removing λ] %s" % e)
+ text = r"An error was encountered. Please use the syntax `!givelambda [user] [how much to remove {integer}] [reason]`"
+
+ update_users_flair(comment)
+ reply = comment.reply(text + tail)
+ reply.mod.distinguish()
+
for submission in submission_stream:
if submission is None: