You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
482 B

3 years ago
package handlers
import (
"context"
"gitea.russia9.dev/russia9/muskrat/storage"
"gopkg.in/telebot.v3"
3 years ago
)
func Router(ctx telebot.Context) error {
state, metadata, err := storage.GetState(context.Background(), ctx.Sender().ID)
if err != nil {
return err
}
switch state {
case "phone":
return Phone(ctx)
case "code":
return Code(ctx, metadata)
case "password":
return Password(ctx, metadata)
case "edit":
return EditInput(ctx, metadata)
}
return List(ctx)
}