From 0d7713123b305123cc9974d4e6efb672b8400772 Mon Sep 17 00:00:00 2001
From: jwansek <eddie.atten.ea29@gmail.com>
Date: Tue, 26 Mar 2019 18:07:13 +0000
Subject: re-added lambda removal feature

---
 SmallYTChannelBotSubmissions.py |  38 +++++++++++++++++++-------------------
 SmallYTChannelDatabase.db       | Bin 3139584 -> 3553280 bytes
 readme.md.save                  |  11 +++++++++++
 3 files changed, 30 insertions(+), 19 deletions(-)
 create mode 100644 readme.md.save

diff --git a/SmallYTChannelBotSubmissions.py b/SmallYTChannelBotSubmissions.py
index 68a6d02..270401c 100644
--- a/SmallYTChannelBotSubmissions.py
+++ b/SmallYTChannelBotSubmissions.py
@@ -203,25 +203,25 @@ def main():
                         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 `!takelambda [user] [how much to remove {integer}] [reason]`"
-                #        reply = comment.reply(text + tail)
-                #        reply.mod.distinguish()
-                #        continue
-
-                #    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 `!takelambda [user] [how much to remove {integer}] [reason]`"
+                            reply = comment.reply(text + tail)
+                            reply.mod.distinguish()
+                            continue
+
+                        update_users_flair(comment.parent())
+                        reply = comment.reply(text + tail)
+                        reply.mod.distinguish()
 
       
             for submission in submission_stream:
diff --git a/SmallYTChannelDatabase.db b/SmallYTChannelDatabase.db
index 91a0c08..94fdd8a 100644
Binary files a/SmallYTChannelDatabase.db and b/SmallYTChannelDatabase.db differ
diff --git a/readme.md.save b/readme.md.save
new file mode 100644
index 0000000..cf9f28a
--- /dev/null
+++ b/readme.md.save
@@ -0,0 +1,11 @@
+#/u/SmallYTChannelBot Source Code
+
+- database.py is for interfacing with the SQLite database
+
+- I chose SQLite instead of MySQL so it's easy to backup
+
+- I backup here every so often, but it is likely to be out of date.
+If I die and someone needs to take over the source code, you'll have to
+write a script that reads everyone's flairs in the subreddit.
+
+- ytapi.py is for getting information about videos using the YouTube API	
-- 
cgit v1.2.3