aboutsummaryrefslogtreecommitdiffstats
path: root/IRC/bot.py
diff options
context:
space:
mode:
authortv <tv@iiso>2011-09-13 17:04:45 +0200
committertv <tv@iiso>2011-09-13 17:04:45 +0200
commit7fb86be4b75f7c1a53e5ee39b620a52f2d35d1bf (patch)
treec47bc370c268fa630bc2672cab8b1f1ef63ef26e /IRC/bot.py
parent8ed75e6eaf2b5050477b644a1bb97e0c182a4260 (diff)
//Reaktor/IRC: replace irclib with own async bot
Unfortunately irclib failed to detect stale connections. Asyboy comes to the rescue (maybe).^_^->deal with it...^_^
Diffstat (limited to 'IRC/bot.py')
-rwxr-xr-xIRC/bot.py34
1 files changed, 0 insertions, 34 deletions
diff --git a/IRC/bot.py b/IRC/bot.py
deleted file mode 100755
index af974f4..0000000
--- a/IRC/bot.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#! /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()