Add a list of invalid commands to ignore

To avoid the botspam when someone's using another bot
This commit is contained in:
moneromooo 2015-01-21 13:50:31 +00:00
parent e893d293f0
commit 1726d85d5c
2 changed files with 12 additions and 1 deletions

View File

@ -169,7 +169,13 @@ def OnCommand(link,cmd,check_admin,check_registered):
else:
c['function'](link,cmd)
else:
link.send("Invalid command, try !help")
silent = False
if link.network.name in config.silent_invalid_commands:
if cmdname in config.silent_invalid_commands[link.network.name]:
log_info('silently ignoring command %s on %s' % (cmdname,link.network.name))
silent = True
if not silent:
link.send("Invalid command, try !help")
def RunIdleFunctions(param=None):
for f in idles:

View File

@ -40,6 +40,11 @@ admins = ["freenode:moneromooo", "freenode:moneromoo"]
# list of nicks to ignore for rains - bots, trolls, etc
no_rain_to_nicks = []
# commands used by other bots, to avoid "unknown command" complaints
silent_invalid_commands = {
'freenode': ['price','worth','net','pools','calc']
}
dice_edge = 0.01
dice_max_bet = 5
dice_min_bet = 0.001