summaryrefslogtreecommitdiffstats
path: root/modules/ping.bash
blob: ece6a1f175449be4a2838c6cc9af7987944af91f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
}