Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chat ¶
type Chat struct {
ID int64 `json:"ID"`
}
Chat contains an ID of a chat with a bot and its messages
type Message ¶
type Message struct { ID int64 `json:"message_id" db:"ID"` FromID int64 `db:"FromID,omitempty"` ChatID int64 `db:"ChatID,omitempty"` Chat Chat `json:"chat" db:"-"` From User `json:"from" db:"-"` Date int64 `json:"date" db:"-"` Text string `json:"text" db:"Text,omitempty"` PrevID sql.NullInt64 `db:"PrevID,omitempty"` NextID sql.NullInt64 `db:"NextID,omitempty"` ActionTrigger string `db:"ActionTrigger"` }
Message contains info about received message, autor and chat ID
func (*Message) ArgsAfterCommand ¶
ArgsAfterCommand - returns text after command. If a message contains one
func (*Message) ChatLastMessage ¶
ChatLastMessage Grabs a last message from current Chat
func (*Message) SetActionTrigger ¶
SetActionTrigger - Marks a message as an action trigger to know, what to do with the next one
type Subscription ¶
type Subscription struct { ID int64 `db:"ID"` UserID int64 `db:"UserID"` ChannelID string `db:"ChannelID"` ChannelName string `db:"ChannelName"` ChannelInfo string `db:"ChannelInfo"` }
Subscription contains an info of subscribed channels
func (*Subscription) Subscribe ¶
func (sub *Subscription) Subscribe() (err error)
Subscribe current channel for new vids
func (*Subscription) Unsubscribe ¶
func (sub *Subscription) Unsubscribe() (err error)
Unsubscribe current channel for new vids
type User ¶
type User struct { ID int64 `json:"id" db:"ID"` IsBot bool `json:"is_bot" db:"-"` FirstName string `json:"first_name" db:"FirstName"` }
User contains basic info about message sender
type Webhook ¶
type Webhook struct { ID int64 `json:"update_id"` Message Message `json:"message,omitempty"` EditedMessage Message `json:"edited_message,omitempty"` CallbackQuery struct { ID string `json:"id,omitempty"` Message Message `json:"message,omitempty"` Data string `json:"data,omitempty"` } `json:"callback_query,omitempty"` }
Webhook contains all the info
func (*Webhook) StoreWebhookInfo ¶
StoreWebhookInfo saves information from webhooks into DB
Click to show internal directories.
Click to hide internal directories.