summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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