tg/src/behx/context.go

34 lines
635 B
Go
Raw Normal View History

2023-07-09 01:28:59 +03:00
package behx
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
U *Update
2023-07-09 01:28:59 +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
}
c.S.PreviousScreenId = c.S.CurrentScreenId
c.S.CurrentScreenId = screenId
2023-07-09 01:28:59 +03:00
return nil
}
// Sends to the user specified text.
2023-07-09 01:28:59 +03:00
func (c *Context) Send(text string) error {
return nil
}