summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--taulubot.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/taulubot.py b/taulubot.py
index 5030e71..40e6367 100644
--- a/taulubot.py
+++ b/taulubot.py
@@ -14,6 +14,7 @@ logging.basicConfig(format='%(asctime)s %(message)s')
taulu_im = Image.open("taulu.png")
golden_im = Image.open("golden.png")
img_size = (640, 640)
+GOLDEN_CHANCE = 2 #%
START_TIME = calendar.timegm(time.gmtime())
taulu_im.thumbnail(img_size, Image.ANTIALIAS)
@@ -41,9 +42,9 @@ def run_taulu(chat_id, user_id):
finalpath = "photo/" + str(abs(user_id)) + "final.png"
# every 100th image has golden borders :)
- golden_chance = random.randrange(1, 100)
- logging.warning("Random gold number was: {}".format(golden_chance))
- is_golden = (golden_chance == 1)
+ golden_number= random.randrange(1, 100)
+ logging.warning("Random gold number was: {}".format(golden_number))
+ is_golden = (golden_number < GOLDEN_CHANCE)
if os.path.exists(finalpath) and not is_golden:
logging.warning("User profile already found. Skipping download and edit...")