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

allow bots to activate plugins, but do not answer them

This commit is contained in:
Thorsten S
2015-12-21 17:03:38 +01:00
parent 5c2f1b82ae
commit d2301d1679
4 changed files with 9 additions and 9 deletions

View File

@@ -978,14 +978,11 @@ def recognize_bots(**args):
@pluginfunction("remove-from-botlist", "remove a user from the botlist", ptypes_COMMAND)
def remove_from_botlist(argv, **args):
if 'remove-from-botlist' != argv[0]:
return
if len(argv) != 2:
return {'msg': "wrong number of arguments!"}
if args['reply_user'] != config.conf_get('bot_owner'):
return {'msg': "only %s may do this!" % config.conf_get('bot_owner')}
if args['reply_user'] != config.conf_get('bot_owner') and args['reply_user'] != argv[1]:
return {'msg': "only %s or the bot may do this!" % config.conf_get('bot_owner')}
if argv[1] in config.runtime_config_store['other_bots']:
config.runtime_config_store['other_bots'].remove(argv[1])