24 lines
335 B
Go
24 lines
335 B
Go
|
package nechotron
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"github.com/NicoNex/echotron/v3"
|
||
|
)
|
||
|
|
||
|
type State struct {
|
||
|
Fn stateFn
|
||
|
Data context.Context
|
||
|
}
|
||
|
|
||
|
type stateFn func(*Update) (*State, error)
|
||
|
|
||
|
var EchoState = State{
|
||
|
Fn: EchoFunc,
|
||
|
}
|
||
|
|
||
|
func EchoFunc(u *Update) (*State, error) {
|
||
|
u.AnswerText(u.Text(), &echotron.MessageOptions{})
|
||
|
return nil, nil
|
||
|
}
|