ignore *bot with possibility for exception
This commit is contained in:
parent
aead137ed7
commit
1a48955ee1
|
@ -6,7 +6,7 @@ posts everything buttbot says to the iambuttbot twitter account
|
|||
import urllib
|
||||
import hook
|
||||
|
||||
@hook.command(hook=r'(.*)', prefix=False)
|
||||
@hook.command(hook=r'(.*)', prefix=False, ignorebots=False)
|
||||
def iambuttbot(bot, input):
|
||||
if input.nick.lower() != 'buttbot':
|
||||
return
|
||||
|
|
|
@ -4,18 +4,19 @@ import hook
|
|||
|
||||
@hook.sieve
|
||||
def sieve_suite(bot, input, func, args):
|
||||
args.setdefault('events', ['PRIVMSG'])
|
||||
events = args.get('events', ['PRIVMSG'])
|
||||
|
||||
if input.command not in args['events']:
|
||||
if args['events'] != '*':
|
||||
if input.command not in events and events != '*':
|
||||
return None
|
||||
|
||||
args.setdefault('hook', r'(.*)')
|
||||
if input.nick.lower()[-3:] == 'bot' and args.get('ignorebots', True):
|
||||
return None
|
||||
|
||||
hook = args.get('hook', r'(.*)')
|
||||
args.setdefault('prefix', True)
|
||||
|
||||
hook = args['hook']
|
||||
if args['prefix']:
|
||||
hook = bot.commandprefix + args['hook']
|
||||
if args.get('prefix', True):
|
||||
hook = bot.commandprefix + hook
|
||||
|
||||
if input.command == 'INVITE':
|
||||
print func, hook
|
||||
|
|
Loading…
Reference in New Issue