summaryrefslogtreecommitdiffstats
path: root/modules/ping.bash
diff options
context:
space:
mode:
authorclsr <clsr@clsr.net>2017-03-22 21:07:10 +0100
committerclsr <clsr@clsr.net>2017-03-22 21:07:10 +0100
commitff2bc5d0931d4a460d4d74183b6f9dd9394c40a0 (patch)
tree13dbf5a1395ae4e3dcd458bf114d962b28a8657c /modules/ping.bash
downloadmbibot-ff2bc5d0931d4a460d4d74183b6f9dd9394c40a0.tar.gz
mbibot-ff2bc5d0931d4a460d4d74183b6f9dd9394c40a0.zip
Initial commitv0.1.0
Diffstat (limited to 'modules/ping.bash')
-rw-r--r--modules/ping.bash17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/ping.bash b/modules/ping.bash
new file mode 100644
index 0000000..ece6a1f
--- /dev/null
+++ b/modules/ping.bash
@@ -0,0 +1,17 @@
+# modules/ping.bash
+#
+# Responds to IRC PINGs.
+
+
+if [ -z "$IRCBOT_MODULE" ]; then
+ printf "error: %s is a module for ircbot.bash and should not be run separately\n" "$0"
+ exit 1
+fi
+
+
+# respond to PINGs
+on_readmsg() { # args: $1 - raw message, $2 - source, $3 - command, $4... - args
+ if [[ $3 == PING ]]; then
+ sendmsg PONG "${@:4}"
+ fi
+}