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

add 'excuse' plugin

This commit is contained in:
urlbot
2015-02-11 01:44:21 +01:00
parent dd85eb1bd9
commit 0ae9a6ba66
2 changed files with 489 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ import traceback
import urllib.parse
from local_config import conf, set_conf
from common import *
from excuses import excuses
from urlbot import extract_title
from functools import wraps
@@ -611,6 +612,19 @@ def command_wp(argv, lang='de', **args):
'msg': 'json data seem to be broken'
}
@pluginfunction('excuse', 'prints BOFH style excuses', ptypes_COMMAND)
def command_dummy(argv, **args):
if 'excuse' != argv[0]:
return
logger('plugin', 'BOFH plugin called')
excuse = random.sample(excuses, 1)[0]
return {
'msg': args['reply_user'] + ': ' + excuse
}
#@pluginfunction('dummy', 'dummy description', ptypes_COMMAND)
#def command_dummy(argv, **args):
# if 'dummy' != argv[0]: