From 28f95d662ca2385661053ef6ea5ad1db665b0fc7 Mon Sep 17 00:00:00 2001 From: jason Date: Thu, 9 Aug 2012 00:21:59 -0600 Subject: added a simple topic archiving module. --- settings.py | 1 + wmd/actions/passive/topic_archive.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 wmd/actions/passive/topic_archive.py diff --git a/settings.py b/settings.py index 0cda3fe..f0c930e 100644 --- a/settings.py +++ b/settings.py @@ -18,6 +18,7 @@ ADMINS = ('com4',) ACTIONS = ( 'wmd.actions.passive.nickserv.IdentWithNickserv', 'wmd.actions.passive.pong.RespondToPing', + 'wmd.actions.passive.topic_archive.TopicArchive', 'wmd.actions.passive.rejoin_on_kick.RejoinOnKick', 'wmd.actions.modules.ReloadModule', 'wmd.actions.modules.LoadModule', diff --git a/wmd/actions/passive/topic_archive.py b/wmd/actions/passive/topic_archive.py new file mode 100644 index 0000000..ba0bf3c --- /dev/null +++ b/wmd/actions/passive/topic_archive.py @@ -0,0 +1,13 @@ +from wmd.actions import Action + +import settings + +class TopicArchive(Action): + def recv_msg(self, irc, obj_data): + if obj_data.command == "TOPIC": + (channel, topic) = obj_data.params.strip().split(" ", 1) + topic = topic[1:] + + f = open("topic_archive.log", "a+") + f.write("%s %s %s" % (channel, obj_data.prefix, topic)) + f.close() \ No newline at end of file -- cgit v1.2.1