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

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

func handleClientPing(msg RMsg, client *Client) (error) {
	if len(msg.Params) < 1 {
		client.Send(SMsg{Command: ERR_NEEDMOREPARAMS, Params: []string{"PING", "Not enough parameters"}})
	}
	client.Send(SMsg{Command: "PONG", Params: []string{msg.Params[0]}})
	return nil
}