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