From f4a473b67e1a1224d28c640461a0c9cdd33a8834 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 6 Sep 2011 13:38:20 +0200 Subject: //Synapse -> //Reaktor/IRC --- Reaktor/IRC/bot.py | 34 +++++++++++++++++ Reaktor/IRC/bot2.py | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++ Reaktor/IRC/content | 1 + Reaktor/IRC/index | 8 ++++ Reaktor/IRC/install | 27 ++++++++++++++ 5 files changed, 173 insertions(+) create mode 100755 Reaktor/IRC/bot.py create mode 100755 Reaktor/IRC/bot2.py create mode 100644 Reaktor/IRC/content create mode 100755 Reaktor/IRC/index create mode 100755 Reaktor/IRC/install (limited to 'Reaktor/IRC') diff --git a/Reaktor/IRC/bot.py b/Reaktor/IRC/bot.py new file mode 100755 index 00000000..af974f4e --- /dev/null +++ b/Reaktor/IRC/bot.py @@ -0,0 +1,34 @@ +#! /usr/bin/env python2 + +from irclib import IRC, ServerConnectionError, is_channel +from sys import exit +from os import environ as env + +host = str(env.get('host', 'irc.freenode.org')) +port = int(env.get('port', 6667)) +nick = str(env.get('nick', 'crabspasm')) +channel = str(env.get('channel', '#tincspasm')) +print '====> irc://%s@%s:%s/%s' % (nick, host, port, channel) + +irc = IRC() +try: + client = irc.server().connect(host, port, nick) +except ServerConnectionError, error: + print error + exit + +def on_connect(connection, event): + connection.join(channel) + print 'Es passiert...' + +def on_join(connection, event): + connection.privmsg(channel, 'lol') + +def on_disconnect(connection, event): + exit + +client.add_global_handler('welcome', on_connect) +client.add_global_handler('join', on_join) +client.add_global_handler('disconnect', on_disconnect) + +irc.process_forever() diff --git a/Reaktor/IRC/bot2.py b/Reaktor/IRC/bot2.py new file mode 100755 index 00000000..0583d329 --- /dev/null +++ b/Reaktor/IRC/bot2.py @@ -0,0 +1,103 @@ +#! /usr/bin/env python + +from __future__ import print_function +from irclib import SimpleIRCClient, ServerConnectionError, is_channel +from sys import exit +from os import environ as env +import re + +class IRCBot(SimpleIRCClient): + def __init__(self, target): + SimpleIRCClient.__init__(self) + self.target = target + + def on_pubmsg(self, connection, event): + + def PRIVMSG(target, text): + self.connection.privmsg(target, text) + + def ME(target, text): + PRIVMSG(target, 'ACTION ' + text + '') + + def is_executable(x): + import os + return os.path.exists(x) and os.access(x, os.X_OK) + + _nickname = connection.get_nickname() + _source = event.source() + _from = _source.split('!', 1)[0] + _target = event.target() + + try: + _, _handle, _command, _argument, _ = re.split( + '^(\w+):\s*(\w+)(?:\s+(.*))?$', event.arguments()[0]) + except ValueError, error: + PRIVMSG(self.target, 'I\'m so famous') + return # ignore + + if _handle == _nickname or _handle == 'ALL': + + from os.path import realpath, dirname, join + from subprocess import Popen as popen, PIPE + + public_commands = join(realpath(dirname(__file__)), 'public_commands') + command = join(public_commands, _command) + + if is_executable(command): + try: + p = popen([command], stdin=PIPE, stdout=PIPE, stderr=PIPE) + except OSError, error: + ME(self.target, 'I am made of stupid') + print('OSError@%s: %s' % (argv, error)) + return + + stdout, stderr = [ x[:len(x)-1] for x in + [ x.split('\n') for x in p.communicate()]] + code = p.returncode + pid = p.pid + + print('command: %s -> %s' % (command, code)) + [print('%s stdout: %s' % (pid, x)) for x in stdout] + [print('%s stderr: %s' % (pid, x)) for x in stderr] + + if code == 0: + [PRIVMSG(self.target, _from + ': ' + x) for x in stdout] + [PRIVMSG(_source, x) for x in stderr] + else: + ME(self.target, 'mimimi') + + else: + ME(self.target, 'believes that ' + _from + ' is made of stupid') + + def on_welcome(self, connection, event): + print('I\'m welcome! :D joining to %s now...' % (self.target)) + if is_channel(self.target): + connection.join(self.target) + else: + self.connection.privmsg(self.target, 'lol') + self.connection.quit('Pong timeout: 423 seconds') + + def on_join(self, connection, event): + print('Es passiert in %s' % (self.target)) + + def on_disconnect(self, connection, event): + # TODO reconnect + exit(0) + +def main(): + host = str(env.get('host', 'irc.freenode.org')) + port = int(env.get('port', 6667)) + nick = str(env.get('nick', 'crabspasm')) + target = str(env.get('target', '#tincspasm')) + print('====> irc://%s@%s:%s/%s' % (nick, host, port, target)) + + client = IRCBot(target) + try: + client.connect(host, port, nick) + except ServerConnectionError, error: + print(error) + exit(1) + client.start() + +if __name__ == "__main__": + main() diff --git a/Reaktor/IRC/content b/Reaktor/IRC/content new file mode 100644 index 00000000..e0292376 --- /dev/null +++ b/Reaktor/IRC/content @@ -0,0 +1 @@ +python-irclib-0.4.6/ircbot.py diff --git a/Reaktor/IRC/index b/Reaktor/IRC/index new file mode 100755 index 00000000..21129c71 --- /dev/null +++ b/Reaktor/IRC/index @@ -0,0 +1,8 @@ +#! /bin/sh +set -xeuf + +cd $(dirname $(readlink -f $0)) + +./install + +exec python2 bot2.py "$@" diff --git a/Reaktor/IRC/install b/Reaktor/IRC/install new file mode 100755 index 00000000..95e05199 --- /dev/null +++ b/Reaktor/IRC/install @@ -0,0 +1,27 @@ +#! /bin/sh +set -xeuf + +cd $(dirname $(readlink -f $0)) + +# install irclib.py +{ + PV=0.4.6 + PN=python-irclib + P=$PN-$PV + tarball=$P.tar.gz + URL=http://downloads.sourceforge.net/$PN/$tarball + SHA1SUM=c6271e44293ed51c21af0f44ce106667d3006e6f + + file=irclib.py + + if ! echo "$SHA1SUM $file" | sha1sum -c; then + temp=`mktemp` + trap "rm -f $temp" EXIT INT + + echo $P/$file > $temp + curl -LfsS $URL | tar --strip-components=1 -zxT $temp + fi + echo "$SHA1SUM $file" | sha1sum -c +} + + -- cgit v1.2.3 From 517b059be3acef5fb921d4899c4bc192ffef1b7c Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 6 Sep 2011 13:44:39 +0200 Subject: //Reaktor/IRC: use //Reaktor/public_commands --- Reaktor/IRC/bot2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Reaktor/IRC') diff --git a/Reaktor/IRC/bot2.py b/Reaktor/IRC/bot2.py index 0583d329..7365686e 100755 --- a/Reaktor/IRC/bot2.py +++ b/Reaktor/IRC/bot2.py @@ -40,7 +40,8 @@ class IRCBot(SimpleIRCClient): from os.path import realpath, dirname, join from subprocess import Popen as popen, PIPE - public_commands = join(realpath(dirname(__file__)), 'public_commands') + Reaktor_dir = dirname(realpath(dirname(__file__))) + public_commands = join(Reaktor_dir, 'public_commands') command = join(public_commands, _command) if is_executable(command): -- cgit v1.2.3 From 9250247e57255ab9886fd15107f4f5ec31a0a888 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 6 Sep 2011 14:36:57 +0200 Subject: //Reaktor/IRC: get name from tinc.conf --- Reaktor/IRC/bot2.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'Reaktor/IRC') diff --git a/Reaktor/IRC/bot2.py b/Reaktor/IRC/bot2.py index 7365686e..49e8a57f 100755 --- a/Reaktor/IRC/bot2.py +++ b/Reaktor/IRC/bot2.py @@ -85,16 +85,32 @@ class IRCBot(SimpleIRCClient): # TODO reconnect exit(0) +# retrieve the value of a [singleton] variable from a tinc.conf(5)-like file +def getconf1(x, path): + from re import findall + pattern = '(?:^|\n)\s*' + x + '\s*=\s*(.*\w)\s*(?:\n|$)' + y = findall(pattern, open(path, 'r').read()) + if len(y) < 1: + raise AttributeError("len(getconf1('%s', '%s') < 1)" % (x, path)) + if len(y) > 1: + y = ' '.join(y) + raise AttributeError("len(getconf1('%s', '%s') > 1)\n ====> %s" + % (x, path, y)) + return y[0] + def main(): - host = str(env.get('host', 'irc.freenode.org')) + name = getconf1('Name', '/etc/tinc/retiolum/tinc.conf') + host = str(env.get('host', 'supernode')) port = int(env.get('port', 6667)) - nick = str(env.get('nick', 'crabspasm')) + nick = str(env.get('nick', name)) target = str(env.get('target', '#tincspasm')) print('====> irc://%s@%s:%s/%s' % (nick, host, port, target)) client = IRCBot(target) try: - client.connect(host, port, nick) + from getpass import getuser + client.connect(host, port, nick, username=getuser(), + ircname='//Reaktor running at %s.retiolum' % (name)) except ServerConnectionError, error: print(error) exit(1) -- cgit v1.2.3 From aae296e484fb5721efd2e39bf3db13407f131d4e Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 6 Sep 2011 14:46:33 +0200 Subject: //Reaktor/IRC: add the relevant documentation --- Reaktor/IRC/bot2.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'Reaktor/IRC') diff --git a/Reaktor/IRC/bot2.py b/Reaktor/IRC/bot2.py index 49e8a57f..a4a8bf33 100755 --- a/Reaktor/IRC/bot2.py +++ b/Reaktor/IRC/bot2.py @@ -1,4 +1,19 @@ #! /usr/bin/env python +# +# //Reaktor/IRC +# +# export host and port to connect to a specific IRC server +# defaults to supernode and 6667 +# +# export nick to use a specific nickname +# defaults to Name in /etc/tinc/retiolum/tinc.conf +# +# export target to join a specific channel +# defaults to #retiolum +# +# Example usage (in your local krebs repository): +# host=irc.freenode.org nick=$HOSTNAME target=#tincspasm Reaktor/IRC/index +# from __future__ import print_function from irclib import SimpleIRCClient, ServerConnectionError, is_channel @@ -100,10 +115,10 @@ def getconf1(x, path): def main(): name = getconf1('Name', '/etc/tinc/retiolum/tinc.conf') + nick = str(env.get('nick', name)) host = str(env.get('host', 'supernode')) port = int(env.get('port', 6667)) - nick = str(env.get('nick', name)) - target = str(env.get('target', '#tincspasm')) + target = str(env.get('target', '#retiolum')) print('====> irc://%s@%s:%s/%s' % (nick, host, port, target)) client = IRCBot(target) -- cgit v1.2.3 From 894d5998a9be987db773aabae21b83014aedabe7 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 6 Sep 2011 15:12:19 +0200 Subject: //Reaktor/IRC: move doc to README.md --- Reaktor/IRC/README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ Reaktor/IRC/bot2.py | 14 +------------- 2 files changed, 51 insertions(+), 13 deletions(-) create mode 100644 Reaktor/IRC/README.md (limited to 'Reaktor/IRC') diff --git a/Reaktor/IRC/README.md b/Reaktor/IRC/README.md new file mode 100644 index 00000000..f831785c --- /dev/null +++ b/Reaktor/IRC/README.md @@ -0,0 +1,50 @@ +# `//Reaktor/IRC` + +This component implements a remote shell daemon that exposes the +executable files (which may be symlinks) below +`//Reaktor/public_commands/` through IRC. + +## Security + +Anyone who has access the the IRC server in question has full access to +all the exposed executable files. The daemon is executing the commands +without dropping privileges. + +## Quickstart + + #? /bin/sh + set -euf + + export nick="$LOGNAME|$HOSTNAME" + export host=irc.freenode.org + export target='#tincspasm' + + exec Reaktor/IRC/index + +## Environment variables + +The following environment variables are processed by `//Reaktor/IRC`: + +### `nick` + +Use a specific nickname. + +Optional if the node running `//Reaktor/IRC` is part of Retiolum, in +which case it defaults to `Name` in `/etc/tinc/retiolum/tinc.conf`. + +### `host` and `port` + +Connect to a specific IRC server. + +Optional if the node running `//Reaktor/IRC` is part of Retiolum, in +which case it defaults to `supernode` and `6667` (well, it always +defaults to these two, but they only make science in Retiolum^_^). + +### `target` + +Join a specific channel. + +As always, this does the right thing for properly configured hosts: it +uses the default `#retiolum`, which is the only really relevant +channel.^_^ + diff --git a/Reaktor/IRC/bot2.py b/Reaktor/IRC/bot2.py index a4a8bf33..170a878f 100755 --- a/Reaktor/IRC/bot2.py +++ b/Reaktor/IRC/bot2.py @@ -1,18 +1,6 @@ #! /usr/bin/env python # -# //Reaktor/IRC -# -# export host and port to connect to a specific IRC server -# defaults to supernode and 6667 -# -# export nick to use a specific nickname -# defaults to Name in /etc/tinc/retiolum/tinc.conf -# -# export target to join a specific channel -# defaults to #retiolum -# -# Example usage (in your local krebs repository): -# host=irc.freenode.org nick=$HOSTNAME target=#tincspasm Reaktor/IRC/index +# //Reaktor/IRC/bot2.py # from __future__ import print_function -- cgit v1.2.3 From 86a44d6eb61a3a218c1f81bf3500c9c14e5521d9 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 6 Sep 2011 15:14:12 +0200 Subject: //Reaktor/IRC: detypo README --- Reaktor/IRC/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Reaktor/IRC') diff --git a/Reaktor/IRC/README.md b/Reaktor/IRC/README.md index f831785c..b51d8743 100644 --- a/Reaktor/IRC/README.md +++ b/Reaktor/IRC/README.md @@ -1,4 +1,4 @@ -# `//Reaktor/IRC` +# *//Reaktor/IRC* This component implements a remote shell daemon that exposes the executable files (which may be symlinks) below @@ -25,14 +25,14 @@ without dropping privileges. The following environment variables are processed by `//Reaktor/IRC`: -### `nick` +### *nick* Use a specific nickname. Optional if the node running `//Reaktor/IRC` is part of Retiolum, in which case it defaults to `Name` in `/etc/tinc/retiolum/tinc.conf`. -### `host` and `port` +### *host* and *port* Connect to a specific IRC server. @@ -40,7 +40,7 @@ Optional if the node running `//Reaktor/IRC` is part of Retiolum, in which case it defaults to `supernode` and `6667` (well, it always defaults to these two, but they only make science in Retiolum^_^). -### `target` +### *target* Join a specific channel. -- cgit v1.2.3 From 0fcc4bbc442335af17433c347841ce6cb6234bd1 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 6 Sep 2011 15:17:53 +0200 Subject: //Reaktor/IRC: detypo README, again --- Reaktor/IRC/README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'Reaktor/IRC') diff --git a/Reaktor/IRC/README.md b/Reaktor/IRC/README.md index b51d8743..63a0ebd2 100644 --- a/Reaktor/IRC/README.md +++ b/Reaktor/IRC/README.md @@ -1,4 +1,4 @@ -# *//Reaktor/IRC* +# //Reaktor/IRC This component implements a remote shell daemon that exposes the executable files (which may be symlinks) below @@ -6,9 +6,8 @@ executable files (which may be symlinks) below ## Security -Anyone who has access the the IRC server in question has full access to -all the exposed executable files. The daemon is executing the commands -without dropping privileges. +Access to the IRC server implies full access to all the exposed executable +files. The daemon is executing the commands without dropping privileges. ## Quickstart @@ -25,14 +24,14 @@ without dropping privileges. The following environment variables are processed by `//Reaktor/IRC`: -### *nick* +### nick Use a specific nickname. Optional if the node running `//Reaktor/IRC` is part of Retiolum, in which case it defaults to `Name` in `/etc/tinc/retiolum/tinc.conf`. -### *host* and *port* +### host and port Connect to a specific IRC server. @@ -40,7 +39,7 @@ Optional if the node running `//Reaktor/IRC` is part of Retiolum, in which case it defaults to `supernode` and `6667` (well, it always defaults to these two, but they only make science in Retiolum^_^). -### *target* +### target Join a specific channel. -- cgit v1.2.3 From c62ed6d11d847bad2d95d4e9db6a4f88012a02aa Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 6 Sep 2011 15:38:10 +0200 Subject: //Reaktor/IRC: export argument to commands --- Reaktor/IRC/bot2.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Reaktor/IRC') diff --git a/Reaktor/IRC/bot2.py b/Reaktor/IRC/bot2.py index 170a878f..092d34bb 100755 --- a/Reaktor/IRC/bot2.py +++ b/Reaktor/IRC/bot2.py @@ -48,10 +48,15 @@ class IRCBot(SimpleIRCClient): command = join(public_commands, _command) if is_executable(command): + + env = {} + if _argument != None: + env['argument'] = _argument + try: - p = popen([command], stdin=PIPE, stdout=PIPE, stderr=PIPE) + p = popen([command], stdin=PIPE, stdout=PIPE, stderr=PIPE, env=env) except OSError, error: - ME(self.target, 'I am made of stupid') + ME(self.target, 'is made of stupid') print('OSError@%s: %s' % (argv, error)) return @@ -65,13 +70,13 @@ class IRCBot(SimpleIRCClient): [print('%s stderr: %s' % (pid, x)) for x in stderr] if code == 0: - [PRIVMSG(self.target, _from + ': ' + x) for x in stdout] + [PRIVMSG(self.target, x) for x in stdout] [PRIVMSG(_source, x) for x in stderr] else: ME(self.target, 'mimimi') else: - ME(self.target, 'believes that ' + _from + ' is made of stupid') + PRIVMSG(self.target, _from + ': you are made of stupid') def on_welcome(self, connection, event): print('I\'m welcome! :D joining to %s now...' % (self.target)) -- cgit v1.2.3 From 5faaba78d89d98f4a8bd9f942e738800f23ba9dc Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 6 Sep 2011 15:46:43 +0200 Subject: //Reaktor/IRC: be famous only sometimes --- Reaktor/IRC/bot2.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Reaktor/IRC') diff --git a/Reaktor/IRC/bot2.py b/Reaktor/IRC/bot2.py index 092d34bb..0279c0f6 100755 --- a/Reaktor/IRC/bot2.py +++ b/Reaktor/IRC/bot2.py @@ -35,7 +35,8 @@ class IRCBot(SimpleIRCClient): _, _handle, _command, _argument, _ = re.split( '^(\w+):\s*(\w+)(?:\s+(.*))?$', event.arguments()[0]) except ValueError, error: - PRIVMSG(self.target, 'I\'m so famous') + if re.search(_nickname, event.arguments()[0]): + PRIVMSG(self.target, 'I\'m so famous') return # ignore if _handle == _nickname or _handle == 'ALL': @@ -57,7 +58,7 @@ class IRCBot(SimpleIRCClient): p = popen([command], stdin=PIPE, stdout=PIPE, stderr=PIPE, env=env) except OSError, error: ME(self.target, 'is made of stupid') - print('OSError@%s: %s' % (argv, error)) + print('OSError@%s: %s' % (command, error)) return stdout, stderr = [ x[:len(x)-1] for x in -- cgit v1.2.3 From c3bc5a6d16868c121aca780f3109155797b51d76 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 6 Sep 2011 19:43:07 +0200 Subject: //Reaktor/IRC: assume python is python2 --- Reaktor/IRC/index | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Reaktor/IRC') diff --git a/Reaktor/IRC/index b/Reaktor/IRC/index index 21129c71..41e3a227 100755 --- a/Reaktor/IRC/index +++ b/Reaktor/IRC/index @@ -5,4 +5,4 @@ cd $(dirname $(readlink -f $0)) ./install -exec python2 bot2.py "$@" +exec python bot2.py "$@" -- cgit v1.2.3 From ed7dce49a177d622858e8eb0a09576c88b0412a1 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 6 Sep 2011 21:04:33 +0200 Subject: //Reaktor/IRC: only direct handle causes stupidity --- Reaktor/IRC/bot2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Reaktor/IRC') diff --git a/Reaktor/IRC/bot2.py b/Reaktor/IRC/bot2.py index 0279c0f6..f8273ffa 100755 --- a/Reaktor/IRC/bot2.py +++ b/Reaktor/IRC/bot2.py @@ -77,7 +77,8 @@ class IRCBot(SimpleIRCClient): ME(self.target, 'mimimi') else: - PRIVMSG(self.target, _from + ': you are made of stupid') + if _handle != 'ALL': + PRIVMSG(self.target, _from + ': you are made of stupid') def on_welcome(self, connection, event): print('I\'m welcome! :D joining to %s now...' % (self.target)) -- cgit v1.2.3 From fb94c450c508bf6c7c0ea1188252e590d5318f9f Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 9 Sep 2011 22:36:31 +0200 Subject: //Reaktor: commands have PWD //Reaktor --- Reaktor/IRC/index | 7 ++++--- Reaktor/IRC/install | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'Reaktor/IRC') diff --git a/Reaktor/IRC/index b/Reaktor/IRC/index index 41e3a227..68b6cf33 100755 --- a/Reaktor/IRC/index +++ b/Reaktor/IRC/index @@ -1,8 +1,9 @@ #! /bin/sh set -xeuf -cd $(dirname $(readlink -f $0)) +# cd //Reaktor +cd $(dirname $(readlink -f $0))/.. -./install +IRC/install -exec python bot2.py "$@" +exec python IRC/bot2.py "$@" diff --git a/Reaktor/IRC/install b/Reaktor/IRC/install index 95e05199..d5f7a8c1 100755 --- a/Reaktor/IRC/install +++ b/Reaktor/IRC/install @@ -1,6 +1,7 @@ #! /bin/sh set -xeuf +# cd //Reaktor/IRC cd $(dirname $(readlink -f $0)) # install irclib.py -- cgit v1.2.3 From e0bd5b4c964dd6db325f4582aa1b73c34575db4b Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 9 Sep 2011 22:42:35 +0200 Subject: //Reaktor/IRC: * > ALL --- Reaktor/IRC/bot2.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Reaktor/IRC') diff --git a/Reaktor/IRC/bot2.py b/Reaktor/IRC/bot2.py index f8273ffa..326dd8f5 100755 --- a/Reaktor/IRC/bot2.py +++ b/Reaktor/IRC/bot2.py @@ -33,13 +33,13 @@ class IRCBot(SimpleIRCClient): try: _, _handle, _command, _argument, _ = re.split( - '^(\w+):\s*(\w+)(?:\s+(.*))?$', event.arguments()[0]) + '^(\w+|\*):\s*(\w+)(?:\s+(.*))?$', event.arguments()[0]) except ValueError, error: if re.search(_nickname, event.arguments()[0]): PRIVMSG(self.target, 'I\'m so famous') return # ignore - if _handle == _nickname or _handle == 'ALL': + if _handle == _nickname or _handle == '*': from os.path import realpath, dirname, join from subprocess import Popen as popen, PIPE @@ -77,7 +77,7 @@ class IRCBot(SimpleIRCClient): ME(self.target, 'mimimi') else: - if _handle != 'ALL': + if _handle != '*': PRIVMSG(self.target, _from + ': you are made of stupid') def on_welcome(self, connection, event): -- cgit v1.2.3