go-dette/states.go

22 lines
563 B
Go
Raw Normal View History

2023-01-20 01:44:57 +03:00
package main
2023-01-20 16:32:21 +03:00
import (
neco "git.nefrace.ru/nefrace/nechotron"
)
var MainState = neco.State{
2023-01-22 23:53:20 +03:00
Fn: func(u *neco.Update) error {
2023-01-24 23:17:30 +03:00
mainCommands := neco.NewDispatcher().
2023-01-22 23:53:20 +03:00
HandleCommand(commandMe, handleMe).
HandleCommand(commandHelp, handleHelp).
HandleCommand(commandSay, handleSay)
2023-01-24 23:17:30 +03:00
replyDispatcher := neco.NewDispatcher().
HandleCommand(commandWarn, handleWarn).
HandleFilter(karmaTriggers, handleKarma)
replies := neco.NewDispatcher().
HandleFilter(neco.IsReply, replyDispatcher.Run)
2023-01-22 23:53:20 +03:00
2023-01-24 23:17:30 +03:00
return neco.ChainRun(u, mainCommands, replies)
2023-01-20 16:32:21 +03:00
},
2023-01-20 01:44:57 +03:00
}