2023-07-09 01:28:59 +03:00
|
|
|
package behx
|
|
|
|
|
2023-07-12 00:33:51 +03:00
|
|
|
import (
|
|
|
|
apix "github.com/go-telegram-bot-api/telegram-bot-api/v5"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Update = apix.Update
|
|
|
|
|
2023-07-09 01:28:59 +03:00
|
|
|
// The type represents way to interact with user in
|
|
|
|
// handling functions. Is provided to Act() function always.
|
|
|
|
type Context struct {
|
|
|
|
S *Session
|
|
|
|
B *Bot
|
2023-07-12 00:33:51 +03:00
|
|
|
U *Update
|
2023-07-09 01:28:59 +03:00
|
|
|
}
|
|
|
|
|
2023-07-12 00:33:51 +03:00
|
|
|
// Changes screen of user to the Id one.
|
|
|
|
func (c *Context) ChangeScreen(screenId ScreenId) error {
|
|
|
|
if !c.B.ScreenExists(screenId) {
|
2023-07-09 01:28:59 +03:00
|
|
|
return ScreenNotExistErr
|
|
|
|
}
|
|
|
|
|
2023-07-12 00:33:51 +03:00
|
|
|
c.S.PreviousScreenId = c.S.CurrentScreenId
|
|
|
|
c.S.CurrentScreenId = screenId
|
|
|
|
|
2023-07-09 01:28:59 +03:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-07-12 00:33:51 +03:00
|
|
|
// Sends to the user specified text.
|
2023-07-09 01:28:59 +03:00
|
|
|
func (c *Context) Send(text string) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|