Documentation ¶
Index ¶
- func GetTelegramToken() string
- func GetTelegramTokenForURL() string
- func InitTelegram(filePath string)
- func OnTelegramUpdate(wh WebhookHandler) func(c *gin.Context)
- func SendMessageTelegram(id int64, msg string)
- func SendPhotoTelegram(id int64, caption, picURL string)
- func URLTelegramUpdate() string
- type Manager
- type TelegramChat
- type TelegramMessage
- type TelegramUpdate
- type TelegramUser
- type WebhookHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTelegramTokenForURL ¶
func GetTelegramTokenForURL() string
GetTelegramTokenForURL get telegram bot's id
func OnTelegramUpdate ¶
func OnTelegramUpdate(wh WebhookHandler) func(c *gin.Context)
OnTelegramUpdate handler for webhook
func SendMessageTelegram ¶
SendMessageTelegram send message to telegram
func SendPhotoTelegram ¶
SendPhotoTelegram send message to telegram
func URLTelegramUpdate ¶
func URLTelegramUpdate() string
URLTelegramUpdate uri where telegram webhook comes
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manager for push
func (*Manager) PushMessage ¶
PushMessage pushes message to Telegram Bot
type TelegramChat ¶
type TelegramChat struct { ID int64 `json:"id"` ChatType string `json:"type"` Title string `json:"title"` Username string `json:"username"` }
TelegramChat TelegramChat
type TelegramMessage ¶
type TelegramMessage struct { MessageID int64 `json:"message_id"` From TelegramUser `json:"from"` Date int64 `json:"date"` Chat TelegramChat `json:"chat"` Text string `json:"text"` }
TelegramMessage TelegramMessage
type TelegramUpdate ¶
type TelegramUpdate struct { UpdateID int64 `json:"update_id"` Message TelegramMessage `json:"message"` }
TelegramUpdate TelegramUpdate
type TelegramUser ¶
type TelegramUser struct { ID int64 `json:"id"` IsBot bool `json:"is_bot"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Username string `json:"username"` LanguageCode string `json:"language_code"` }
TelegramUser TelegramUser
type WebhookHandler ¶
WebhookHandler handler for webhook
Click to show internal directories.
Click to hide internal directories.