diff options
| author | jason | 2012-08-09 00:21:59 -0600 |
|---|---|---|
| committer | jason | 2012-08-09 00:21:59 -0600 |
| commit | 28f95d662ca2385661053ef6ea5ad1db665b0fc7 (patch) | |
| tree | f4aada470502999be5fd0a3baf6fc6a57f4f71b0 | |
| parent | 972a7cc25b8c9599a904655600123fe054436dae (diff) | |
| download | warmachine-28f95d662ca2385661053ef6ea5ad1db665b0fc7.tar.gz warmachine-28f95d662ca2385661053ef6ea5ad1db665b0fc7.zip | |
added a simple topic archiving module.
| -rw-r--r-- | settings.py | 1 | ||||
| -rw-r--r-- | wmd/actions/passive/topic_archive.py | 13 |
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',) | |||
| 18 | ACTIONS = ( | 18 | ACTIONS = ( |
| 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 @@ | |||
| 1 | from wmd.actions import Action | ||
| 2 | |||
| 3 | import settings | ||
| 4 | |||
| 5 | class 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 | ||