spammer: add show_triggers and add_trigger admin commands

This commit is contained in:
moneromooo 2016-11-28 19:38:46 +00:00
parent 59bba00130
commit e387fa67ab

View file

@ -67,6 +67,12 @@ def OnMessage(event,*args,**kwargs):
Ban(link) Ban(link)
return return
def AddTrigger(link,cmd):
triggers.append(" ".join(cmd[1:]))
def ShowTriggers(link,cmd):
link.send(", ".join(triggers))
def Help(link): def Help(link):
link.send_private('Ban assholes') link.send_private('Ban assholes')
@ -85,3 +91,17 @@ RegisterEventHandler({
'event': 'message', 'event': 'message',
'function': OnMessage, 'function': OnMessage,
}) })
RegisterCommand({
'module': __name__,
'name': 'add_trigger',
'function': AddTrigger,
'admin': True,
'help': "add keyword trigger to spammer trap"
})
RegisterCommand({
'module': __name__,
'name': 'show_triggers',
'function': ShowTriggers,
'admin': True,
'help': "list keyword triggers"
})