package main import ( neco "git.nefrace.ru/nefrace/nechotron" ) var MainState = neco.State{ Fn: func(u *neco.Update) error { mainCommands := neco.NewDispatcher(). HandleCommand(commandMe, handleMe). HandleCommand(commandHelp, handleHelp). HandleCommand(commandSay, handleSay) replyDispatcher := neco.NewDispatcher(). HandleCommand(commandWarn, handleWarn). HandleFilter(karmaTriggers, handleKarma) replies := neco.NewDispatcher(). HandleFilter(neco.IsReply, replyDispatcher.Run) return neco.ChainRun(u, mainCommands, replies) }, }