From ff2bc5d0931d4a460d4d74183b6f9dd9394c40a0 Mon Sep 17 00:00:00 2001 From: clsr Date: Wed, 22 Mar 2017 21:07:10 +0100 Subject: Initial commit --- modules/ping.bash | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 modules/ping.bash (limited to 'modules/ping.bash') 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 +} -- cgit