Documentation ¶
Index ¶
- Variables
- func Handle(bot *telegram.BotAPI, message *telegram.Message)
- func HandleCallback(bot *telegram.BotAPI, update *telegram.Update)
- func Initialize(db *database.MySQL)
- func Register(command Command)
- func RegisterCallback(callback Callback)
- func SetAPIKey(bot *telegram.BotAPI, message *telegram.Message)
- type Callback
- type ChatSession
- type Command
- type SessionManager
Constants ¶
This section is empty.
Variables ¶
View Source
var Callbacks = []Callback{}
View Source
var Commands = []Command{}
View Source
var DB database.MySQL
View Source
var SampleInserts = `` /* 1464-byte string literal not displayed */
View Source
var SampleQueries = `` /* 503-byte string literal not displayed */
View Source
var WelcomeBackMessage = `
Hello %s!, welcome back to SQL Sensi, your account already exists!
`
View Source
var WelcomeMessage = `` /* 426-byte string literal not displayed */
Functions ¶
func Initialize ¶
func RegisterCallback ¶
func RegisterCallback(callback Callback)
Types ¶
type Callback ¶
type Callback struct { Name string Handler func(*telegram.BotAPI, *telegram.CallbackQuery) }
type ChatSession ¶
ChatSession represents a single chat session with history
type Command ¶
type Command struct { Name string Description string Handler func(*telegram.BotAPI, *telegram.Message) Usage string }
func HelpCommand ¶
func HelpCommand() Command
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
SessionManager manages chat sessions for different users
func NewSessionManager ¶
func NewSessionManager() *SessionManager
NewSessionManager creates a new session manager
func (*SessionManager) Clear ¶
func (sm *SessionManager) Clear(chatID int64)
Clear clears the chat history for a given chat ID
func (*SessionManager) GetOrCreate ¶
func (sm *SessionManager) GetOrCreate(chatID int64) *ChatSession
GetOrCreate gets an existing session or creates a new one
Click to show internal directories.
Click to hide internal directories.