mirror of
http://aero2k.de/t/repos/urlbot-native.git
synced 2017-09-06 15:25:38 +02:00
add /me parser
This commit is contained in:
17
plugins.py
17
plugins.py
@@ -110,6 +110,23 @@ def parse_latex(**args):
|
|||||||
'msg': '''LaTeX is way too complex for me, I'm happy with fmt(1)'''
|
'msg': '''LaTeX is way too complex for me, I'm happy with fmt(1)'''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@pluginfunction('/me', 'reacts to /me.*%{bot_user}', ptypes_PARSE)
|
||||||
|
def parse_slash_me(**args):
|
||||||
|
if args['data'].lower().startswith('/me') and (conf('bot_user') in args['data'].lower()):
|
||||||
|
logger('plugin', 'sent /me reply')
|
||||||
|
|
||||||
|
me_replys = [
|
||||||
|
'are you that rude to everybody?',
|
||||||
|
'oh, thank you...',
|
||||||
|
'do you really think that was nice?',
|
||||||
|
'that sounds very interesting...',
|
||||||
|
"excuse me, but I'm already late for an appointment"
|
||||||
|
]
|
||||||
|
|
||||||
|
return {
|
||||||
|
'msg': args['reply_user'] + ': %s' % (random.sample(me_replys, 1)[0])
|
||||||
|
}
|
||||||
|
|
||||||
#@pluginfunction('dummy_parser', 'dummy_parser desc', ptypes_PARSE)
|
#@pluginfunction('dummy_parser', 'dummy_parser desc', ptypes_PARSE)
|
||||||
#def parse_skynet(**args):
|
#def parse_skynet(**args):
|
||||||
# if 'dummy_parser' in args['data'].lower():
|
# if 'dummy_parser' in args['data'].lower():
|
||||||
|
|||||||
@@ -242,6 +242,8 @@ def handle_msg(msg_obj):
|
|||||||
if not nospoiler:
|
if not nospoiler:
|
||||||
ret = extract_url(content, msg_obj)
|
ret = extract_url(content, msg_obj)
|
||||||
|
|
||||||
|
# print(' '.join(["%s->%s" % (x, msg_obj[x]) for x in msg_obj.keys()]))
|
||||||
|
|
||||||
if True != ret:
|
if True != ret:
|
||||||
plugins.data_parse_commands(msg_obj)
|
plugins.data_parse_commands(msg_obj)
|
||||||
plugins.data_parse_other(msg_obj)
|
plugins.data_parse_other(msg_obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user