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
463 B

3 years ago
package handlers
import (
"context"
"gopkg.in/tucnak/telebot.v3"
"muskrat/storage"
)
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)
}