aboutsummaryrefslogtreecommitdiff
path: root/cmd_ping.go
blob: c5442b5406a25119fea94d3e9a45bcb9cea10ebb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package main

func init() {
	commandHandlers["PING"] = handleClientPing
}

func handleClientPing(msg RMsg, client *Client) bool {
	if len(msg.Params) < 1 {
		client.Send(MakeMsg(self, ERR_NEEDMOREPARAMS, "PING", "Not enough parameters"))
		return true
	}
	client.Send(MakeMsg(self, "PONG", msg.Params[0]))
	return true
}