From bfa3fb6e74b17bf27ca607c072e5f81891ed2642 Mon Sep 17 00:00:00 2001 From: Michael Stummvoll Date: Thu, 19 Feb 2015 17:20:35 +0100 Subject: [PATCH 1/3] move version check into own plugin --- plugins/bad_version.py | 28 ++++++++++++++++++++++++++++ plugins/chch_worker.py | 10 ---------- 2 files changed, 28 insertions(+), 10 deletions(-) create mode 100644 plugins/bad_version.py diff --git a/plugins/bad_version.py b/plugins/bad_version.py new file mode 100644 index 0000000..9465f2d --- /dev/null +++ b/plugins/bad_version.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +from util import hook +from thread import start_new_thread +from time import sleep + +def wait_and_send(conn, wait, msg): + sleep(wait) + conn.send(msg) + +@hook.command("check") +def check_nick(inp, conn=None): + conn.send("PRIVMSG %s :\x01VERSION\x01" % inp) + + +@hook.event("JOIN") +def handle_join(info, input=None, conn=None): + start_new_thread(wait_and_send, (conn, 5, "PRIVMSG %s :\x01VERSION\x01" % input.nick)) + +@hook.event("NOTICE") +def handle_ctcp_rply(info, input=None, conn=None, nick=None): + print "notice..." + print "-%s-" % input.lastparam + if input.lastparam == ("\1VERSION %s\1" % "mIRC v7.22 Khaled Mardam-Bey"): + for chan in conn.channels: + if chan != "#logbot": + conn.send("KICK %s %s :bad version" % (chan, nick)) + conn.send("MODE %s +b %s!*@*$#logbot" % (chan, nick)) + diff --git a/plugins/chch_worker.py b/plugins/chch_worker.py index c0a95c9..5ebc24f 100644 --- a/plugins/chch_worker.py +++ b/plugins/chch_worker.py @@ -162,16 +162,6 @@ def topic_update(info, conn=None, chan=None): if new_topic != topic: conn.send("TOPIC %s :%s" % (chan, new_topic)) -@hook.event("JOIN") -def handle_join(info, input=None, conn=None): - conn.ctcp(input.nick, "VERSION", "") - -@hook.event("NOTICE") -def handle_ctcp_rply(info, input=None, conn=None, nick=None): - if input.lastparam == "\1%s\1" % "mIRC v7.22 Khaled Mardam-Bey": - for chan in conn.channels: - conn.send("KICK %s %s :bad version" % (chan, nick)) - @hook.event("332") def e332_update(info, conn=None, chan=None): """e332_update -- run after current topic was requested, runs worker tasks too""" From 05bfb9099a499a2ef5271450f9c22ea3e6a64925 Mon Sep 17 00:00:00 2001 From: Michael Stummvoll Date: Thu, 19 Feb 2015 17:20:59 +0100 Subject: [PATCH 2/3] disable chch_worker --- {plugins => disabled_stuff}/chch_worker.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {plugins => disabled_stuff}/chch_worker.py (100%) diff --git a/plugins/chch_worker.py b/disabled_stuff/chch_worker.py similarity index 100% rename from plugins/chch_worker.py rename to disabled_stuff/chch_worker.py From 4e386c90083abb8b7fbb70a7e540ecc08a51a559 Mon Sep 17 00:00:00 2001 From: Michael Stummvoll Date: Thu, 19 Feb 2015 17:22:27 +0100 Subject: [PATCH 3/3] update default config --- config.default | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/config.default b/config.default index 350feb2..4bda1b0 100644 --- a/config.default +++ b/config.default @@ -1,16 +1,16 @@ { "connections": { - "esper": { - "server": "irc.esper.net", - "nick": "MyCloudBot", - "user": "cloudbot", + "hackint": { + "server": "irc.hackint.eu", + "nick": "antibot", + "user": "antibot", "realname": "CloudBot - http://git.io/cloudbotirc", "mode": "", - "nickserv_password": "", - "nickserv_user": "", + "_nickserv_password": "", + "-nickserv_user": "", "channels": [ - "#cloudbot", - "#cloudbot2" + "#ChaosChemnitz", + "#logbot" ], "invite_join": true, "auto_rejoin": false, @@ -58,7 +58,7 @@ "ignore" ], "users": [ - "examplec!user@example.com" + "stummi!~Stummi@stummi.org" ] } },