1
0
mirror of http://aero2k.de/t/repos/urlbot-native.git synced 2017-09-06 15:25:38 +02:00

only run parse_* if no URL detected

This commit is contained in:
urlbot
2014-08-02 20:48:06 +02:00
parent 8377bc3b3a
commit ffa4dae9da

View File

@@ -96,6 +96,7 @@ def ratelimit_exceeded():
return False
def extract_url(data):
ret = None
result = re.findall("(https?://[^\s>]+)", data)
if result:
for r in result:
@@ -123,6 +124,8 @@ def extract_url(data):
logger('info', 'printing ' + message)
chat_write(message)
ret = True
return ret
def mental_ill(data):
min_ill = 3
@@ -197,9 +200,9 @@ def parse_delete(filepath):
if content[1:1+len(bot_user)] != bot_user:
if not 'Willkommen bei debianforum.de' in content:
extract_url(content)
parse_commands(content)
parse_other(content)
if True != extract_url(content):
parse_commands(content)
parse_other(content)
fd.close()