aboutsummaryrefslogtreecommitdiffstats
path: root/subreddit.py
diff options
context:
space:
mode:
Diffstat (limited to 'subreddit.py')
-rwxr-xr-xsubreddit.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/subreddit.py b/subreddit.py
index eece316..8306f75 100755
--- a/subreddit.py
+++ b/subreddit.py
@@ -115,13 +115,13 @@ def update_tables(scores, data):
REDDIT.subreddit("u_SmallYTChannelBot").submit("/r/SmallYTChannel Statistics: %s" % date, url = imageurl).reply(content).mod.distinguish(sticky = True)
- SUBREDDIT.wiki["lambdatables"].edit(content, reason = "Update: %s" % date)
- SUBREDDIT.wiki[date].edit(content, reason = "Update: %s" % date)
+ #SUBREDDIT.wiki["lambdatables"].edit(content, reason = "Update: %s" % date)
+ #SUBREDDIT.wiki[date].edit(content, reason = "Update: %s" % date)
- currentdata = SUBREDDIT.wiki["index"].content_md
- currentdata += "\n\n* [%s](/r/SmallYTChannel/wiki/%s)" % (date, date)
+ #currentdata = SUBREDDIT.wiki["index"].content_md
+ #currentdata += "\n\n* [%s](/r/SmallYTChannel/wiki/%s)" % (date, date)
- SUBREDDIT.wiki["index"].edit(currentdata, reason = "Update: %s" % date)
+ #SUBREDDIT.wiki["index"].edit(currentdata, reason = "Update: %s" % date)
def upload_image(path, date):
config = {
@@ -195,10 +195,15 @@ def handle_givelambda(comment):
display(text, concerning=comment.permalink)
elif submission.link_flair_text in FREE_FLAIRS:
text = "You cannot give lambda in free posts anymore."
+ display("Giving lambda was rejected due to being a free post", concerning=comment.permalink)
elif op != str(submission.author):
text = "Only the OP can give λ."
elif db.user_given_lambda(parentauthour, str(submission.permalink)):
text = "You have already given /u/%s λ for this submission. Why not give λ to another user instead?" % parentauthour
+ display("Giving lambda was rejected for being the same user", concerning=comment.permalink)
+ elif len(comment.parent().body) < CONFIG["min_comment_len"]:
+ text = "You can no longer give λ to comments that are fewer than %i characters in length. This is to encourage specific, detailed feedback." % CONFIG["min_comment_len"]
+ display("Giving lambda was rejected due to insufficient length", concerning=comment.permalink)
else:
display("'/u/%s' has given '/u/%s' lambda!" % (op, parentauthour), concerning=comment.permalink)
text = "You have given /u/%s 1λ. /u/%s now has %iλ" % (parentauthour, parentauthour, db.get_lambda(parentauthour)[0] + 1)
@@ -217,7 +222,7 @@ def handle_givelambda(comment):
def handle_takelambda(comment):
try:
splitted = comment.body.split()
- user = splitted[1].replace("/u/", "")
+ user = splitted[1].replace("/u/", "").replace("u/", "")
toremove = int(splitted[2].replace("\\", ""))
reason = " ".join(splitted[3:])
@@ -235,7 +240,7 @@ def handle_takelambda(comment):
def handle_refundlambda(comment):
try:
splitted = comment.body.split()
- user = splitted[1].replace("/u/", "")
+ user = splitted[1].replace("/u/", "").replace("u/", "")
toadd = int(splitted[2].replace("\\", ""))
reason = " ".join(splitted[3:])