func (ctx *Context) WebSocketRTM() {
	ctx.webSocketRTM(func(event plugins.BotEvent) { log.Println("connected ", event.Channel()) })
}
WebSocketRTM is Deprecated
package slackbot
import (
	"errors"
	"fmt"
	"log"
	"github.com/nlopes/slack"
	"github.com/kyokomi/slackbot/plugins"
	"github.com/kyokomi/slackbot/plugins/sysstd"
)
type BotContext interface {
	PluginManager() plugins.PluginManager
	AddPlugin(key interface{}, val plugins.BotMessagePlugin)
	WebSocketRTM()
	Run(connectedFunc func(event plugins.BotEvent))
	SendMessage(message, channel string)
}
type Context struct {
	Plugins plugins.PluginManager
	Client  *slack.Client
	RTM     *slack.RTM
}
func (b *Context) PluginManager() plugins.PluginManager {
	return b.Plugins
}
func NewContext(token string) (*Context, error) {
	ctx, err := NewBotContextNotSysstd(token)
	if err != nil {
		return nil, err
	}
	ctx.AddPlugin("sysstd", sysstd.NewPlugin(ctx.PluginManager()))
	return ctx, nil
}
func NewBotContext(token string) (BotContext, error) {
	ctx, err := NewBotContextNotSysstd(token)
	if err != nil {
		return nil, err
	}
	ctx.AddPlugin("sysstd", sysstd.NewPlugin(ctx.PluginManager()))
	return ctx, nil
}
func NewBotContextNotSysstd(token string) (*Context, error) {
	if token == "" {
		return nil, errors.New("ERROR: slack token not found")
	}
	ctx := &Context{}
	ctx.Client = slack.New(token)
	ctx.Plugins = plugins.NewPluginManager(ctx)
	return ctx, nil
}
func (ctx *Context) AddPlugin(key interface{}, val plugins.BotMessagePlugin) {
	fmt.Println("insert plugin ", key)
	ctx.Plugins.AddPlugin(key, val)
}
func (ctx *Context) Run(connectedFunc func(event plugins.BotEvent)) {
	ctx.webSocketRTM(connectedFunc)
}