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.
27 lines
482 B
27 lines
482 B
package handlers |
|
|
|
import ( |
|
"context" |
|
"gitea.russia9.dev/russia9/muskrat/storage" |
|
"gopkg.in/telebot.v3" |
|
) |
|
|
|
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) |
|
}
|
|
|