summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason2012-07-21 14:54:20 -0600
committerjason2012-07-21 14:54:20 -0600
commit95413bf63d54eb08ce4fb2dc972559f36551b195 (patch)
treee96468565c28b1ea28378184ad18dcfb1f69efdc
parentbfbae7bffc6d521a150151452247c2d5b5904bb9 (diff)
downloadwarmachine-95413bf63d54eb08ce4fb2dc972559f36551b195.tar.gz
warmachine-95413bf63d54eb08ce4fb2dc972559f36551b195.zip
Added a plugin to respond to server pings.
-rw-r--r--settings.py1
-rw-r--r--wmd/actions/passive/pong.py14
2 files changed, 15 insertions, 0 deletions
diff --git a/settings.py b/settings.py
index b9d2cfd..ec2668f 100644
--- a/settings.py
+++ b/settings.py
@@ -17,6 +17,7 @@ ADMINS = ('com4',)
17 17
18ACTIONS = ( 18ACTIONS = (
19 'wmd.actions.passive.nickserv.IdentWithNickserv', 19 'wmd.actions.passive.nickserv.IdentWithNickserv',
20 'wmd.actions.passive.pong.RespondToPing',
20) 21)
21 22
22try: 23try:
diff --git a/wmd/actions/passive/pong.py b/wmd/actions/passive/pong.py
new file mode 100644
index 0000000..813147d
--- /dev/null
+++ b/wmd/actions/passive/pong.py
@@ -0,0 +1,14 @@
1from wmd.actions import Action
2
3import settings
4
5class RespondToPing(Action):
6 def recv_msg(self, irc, obj_data):
7 if obj_data.command == "PING":
8 if obj_data.params[0] == ":":
9 server = obj_data.params[1:]
10 else:
11 server = obj_data.params
12 msg = "-> PONG %s" % server
13 print msg
14 irc.rawsend(msg) \ No newline at end of file