func RTMOptionPingInterval(d time.Duration) RTMOption {
	return func(rtm *RTM) {
		rtm.pingInterval = d
		rtm.resetDeadman()
	}
}
RTMOptionPingInterval determines how often to deliver a ping message to slack.
package slack
import (
	"context"
	"net/url"
	"sync"
	"time"
	"github.com/gorilla/websocket"
)
const (
	websocketDefaultTimeout = 10 * time.Second
	defaultPingInterval     = 30 * time.Second
)
const (
	rtmEventTypeAck                 = ""
	rtmEventTypeHello               = "hello"
	rtmEventTypeGoodbye             = "goodbye"
	rtmEventTypePong                = "pong"
	rtmEventTypeDesktopNotification = "desktop_notification"
)
func (api *Client) StartRTM() (info *Info, websocketURL string, err error) {
	ctx, cancel := context.WithTimeout(context.Background(), websocketDefaultTimeout)
	defer cancel()
	return api.StartRTMContext(ctx)
}
func (api *Client) StartRTMContext(ctx context.Context) (info *Info, websocketURL string, err error) {
	response := &infoResponseFull{}
	err = api.postMethod(ctx, "rtm.start", url.Values{"token": {api.token}}, response)
	if err != nil {
		return nil, "", err
	}
	api.Debugln("Using URL:", response.Info.URL)
	return &response.Info, response.Info.URL, response.Err()
}
func (api *Client) ConnectRTM() (info *Info, websocketURL string, err error) {
	ctx, cancel := context.WithTimeout(context.Background(), websocketDefaultTimeout)
	defer cancel()
	return api.ConnectRTMContext(ctx)
}
func (api *Client) ConnectRTMContext(ctx context.Context) (info *Info, websocketURL string, err error) {
	response := &infoResponseFull{}
	err = api.postMethod(ctx, "rtm.connect", url.Values{"token": {api.token}}, response)
	if err != nil {
		api.Debugf("Failed to connect to RTM: %s", err)
		return nil, "", err
	}
	api.Debugln("Using URL:", response.Info.URL)
	return &response.Info, response.Info.URL, response.Err()
}
type RTMOption func(*RTM)
func RTMOptionUseStart(b bool) RTMOption {
	return func(rtm *RTM) {
		rtm.useRTMStart = b
	}
}
func RTMOptionDialer(d *websocket.Dialer) RTMOption {
	return func(rtm *RTM) {
		rtm.dialer = d
	}
}