[O] Handle null case for token
This commit is contained in:
+6
-1
@@ -1,5 +1,10 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
token = os.getenv('TG_TOKEN', None)
|
||||
if token is None:
|
||||
print('Please configure your token in environment variable TG_TOKEN first.')
|
||||
sys.exit(0)
|
||||
|
||||
token = os.environ['TG_TOKEN']
|
||||
font = os.getenv('FONT', None)
|
||||
dbPath = 'database.json'
|
||||
|
||||
+2
-2
@@ -41,8 +41,6 @@ class Scheduler:
|
||||
|
||||
# Function to update a single task
|
||||
def updateTask(cache: CacheEntry):
|
||||
print("DEBUG: Sending request - %s" % cache.name, nowText)
|
||||
|
||||
request = self.database.reqs[cache.user][cache.name]
|
||||
if now - cache.time < request.get('interval', 120):
|
||||
return
|
||||
@@ -63,6 +61,8 @@ class Scheduler:
|
||||
cache.time = now
|
||||
|
||||
if diff != '':
|
||||
print("DEBUG: Diff detected - %s" % cache.name, nowText)
|
||||
|
||||
# Render diff
|
||||
doc = BytesIO(render(diff))
|
||||
fileName = 'diff %s %s.png' % (cache.name, nowText)
|
||||
|
||||
Reference in New Issue
Block a user