Beispiel #1
0
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
}
Beispiel #2
0
func TestDoAction(t *testing.T) {
	p := sysstd.NewPlugin(nil)

	next := p.DoAction(testEvent, "date a 1 3")

	if next != false {
		t.Errorf("ERROR next != false")
	}
}
Beispiel #3
0
func TestCheckMessage(t *testing.T) {
	p := sysstd.NewPlugin(nil)
	ok, message := p.CheckMessage(testEvent, testEvent.BaseText())
	if !ok {
		t.Errorf("ERROR check = NG")
	} else {
		fmt.Println(message)
	}
}
Beispiel #4
0
func TestSysstdBuildPluginsHelp(t *testing.T) {
	botCtx, err := slackbot.NewBotContext("hoge_token")
	if err != nil {
		t.Error(err)
	}
	botCtx.AddPlugin("echo", echo.NewPlugin())
	p := sysstd.NewPlugin(botCtx.PluginManager())

	ev := plugins.NewTestEvent("botID help")
	p.DoAction(ev, "help")
}
Beispiel #5
0
func TestSetTimezone(t *testing.T) {
	p := sysstd.NewPlugin(nil)
	p.SetTimezone("JST")
}
Beispiel #6
0
func TestSysstdDebug(t *testing.T) {
	p := sysstd.NewPlugin(nil)
	p.SetDebug(true)
}