summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason2012-08-09 00:21:59 -0600
committerjason2012-08-09 00:21:59 -0600
commit28f95d662ca2385661053ef6ea5ad1db665b0fc7 (patch)
treef4aada470502999be5fd0a3baf6fc6a57f4f71b0
parent972a7cc25b8c9599a904655600123fe054436dae (diff)
downloadwarmachine-28f95d662ca2385661053ef6ea5ad1db665b0fc7.tar.gz
warmachine-28f95d662ca2385661053ef6ea5ad1db665b0fc7.zip
added a simple topic archiving module.
-rw-r--r--settings.py1
-rw-r--r--wmd/actions/passive/topic_archive.py13
2 files changed, 14 insertions, 0 deletions
diff --git a/settings.py b/settings.py
index 0cda3fe..f0c930e 100644
--- a/settings.py
+++ b/settings.py
@@ -18,6 +18,7 @@ ADMINS = ('com4',)
18ACTIONS = ( 18ACTIONS = (
19 'wmd.actions.passive.nickserv.IdentWithNickserv', 19 'wmd.actions.passive.nickserv.IdentWithNickserv',
20 'wmd.actions.passive.pong.RespondToPing', 20 'wmd.actions.passive.pong.RespondToPing',
21 'wmd.actions.passive.topic_archive.TopicArchive',
21 'wmd.actions.passive.rejoin_on_kick.RejoinOnKick', 22 'wmd.actions.passive.rejoin_on_kick.RejoinOnKick',
22 'wmd.actions.modules.ReloadModule', 23 'wmd.actions.modules.ReloadModule',
23 'wmd.actions.modules.LoadModule', 24 '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 @@
1from wmd.actions import Action
2
3import settings
4
5class TopicArchive(Action):
6 def recv_msg(self, irc, obj_data):
7 if obj_data.command == "TOPIC":
8 (channel, topic) = obj_data.params.strip().split(" ", 1)
9 topic = topic[1:]
10
11 f = open("topic_archive.log", "a+")
12 f.write("%s %s %s" % (channel, obj_data.prefix, topic))
13 f.close() \ No newline at end of file