diff options
author | tv <tv@nomic.retiolum> | 2013-12-18 16:58:51 +0100 |
---|---|---|
committer | tv <tv@nomic.retiolum> | 2013-12-18 16:58:51 +0100 |
commit | f48968d7c849419bdaed49093c23f2a2cc774577 (patch) | |
tree | c3464e6bb47d50e09a9373949e8e4f428e7500d8 | |
parent | aa7cd8834b21a064e4fe0440b956f6c174949ed2 (diff) |
Reaktor: listen to own name
-rw-r--r-- | config.py | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -12,13 +12,19 @@ irc_channels = [ '#krebs' ] +def default_command(cmd): + return { + 'pattern': '^(?:' + name + '|\\*):\\s*' + cmd + '\\s*$', + 'argv': [ 'commands/' + cmd ] } + irc_commands = [ - { 'pattern': '^(?:asybot|\\*):\\s*caps\\s*$', 'argv': [ 'commands/caps' ] }, - { 'pattern': '^(?:asybot|\\*):\\s*hello\\s*$', 'argv': [ 'commands/hello' ] }, - { 'pattern': '^(?:asybot|\\*):\\s*reload\\s*$', 'argv': [ 'commands/reload' ] }, - { 'pattern': '^(?:asybot|\\*):\\s*badcommand\\s*$', 'argv': [ 'commands/badcommand' ] }, - { 'pattern': '^(?:asybot|\\*):\\s*rev\\s*$', 'argv': [ 'commands/rev' ] }, - { 'pattern': '^(?:asybot|\\*):\\s*uptime\\s*$', 'argv': [ 'commands/uptime' ] }, - { 'pattern': '^(?:asybot|\\*):\\s*nocommand\\s*$', 'argv': [ 'commands/nocommand' ] }, - { 'pattern': '^.*\\basybot(?:\\b[^:].*)?$', 'argv': [ 'commands/say', 'I\'m famous' ] } + default_command('caps'), + default_command('hello'), + default_command('reload'), + default_command('badcommand'), + default_command('rev'), + default_command('uptime'), + default_command('nocommand'), + { 'pattern': '^.*\\b' + name + '(?:\\b[^:].*)?$', + 'argv': [ 'commands/say', 'I\'m famous' ] } ] |