Add +min feature to alert

This commit is contained in:
Alexandr
2019-01-26 14:31:01 +03:00
parent b990f3eec8
commit a6d7903c57
2 changed files with 11 additions and 4 deletions

View File

@ -44,9 +44,16 @@ class MessageWorker:
def isTime(self, string):
try:
time.strptime(string, '%H%M')
return True
return string
except ValueError:
return False
pass
try:
if (int(string[1:]) > 0) and (string[0] == '+') and (len(string[1:]) < 3):
return string
except:
pass
return False
def colorize(self, code):
code_tag = code[code.rfind('#') + 1:]
@ -209,7 +216,6 @@ class MessageWorker:
chat_title = msg['message']['chat']['title']
self.db.add_conf(conf_id, chat_title)
if len(msg['message']['text'][6:]) < 10000:
print(msg['message']['text'][6:])
try:
self.colorize(msg['message']['text'][6:])
except Exception as e: