telegrambot

package
v2.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MarkdownFormatting   = "Markdown"
	MarkdownV2Formatting = "MarkdownV2"
	HTMLFormatting       = "HTML"
)

Variables

This section is empty.

Functions

func PushEntry

func PushEntry(feed *model.Feed, entry *model.Entry, botToken, chatID string, topicID *int64, disableWebPagePreview, disableNotification bool, disableButtons bool) error

Types

type BaseResponse added in v2.0.48

type BaseResponse struct {
	Ok          bool   `json:"ok"`
	ErrorCode   int    `json:"error_code"`
	Description string `json:"description"`
}

type Chat added in v2.0.48

type Chat struct {
	ID    int64  `json:"id"`
	Type  string `json:"type"`
	Title string `json:"title"`
}

type Client added in v2.0.48

type Client struct {
	// contains filtered or unexported fields
}

func NewClient added in v2.0.48

func NewClient(botToken, chatID string) *Client

func (*Client) GetMe added in v2.0.48

func (c *Client) GetMe() (*User, error)

Specs: https://core.telegram.org/bots/api#getme

func (*Client) SendMessage added in v2.0.48

func (c *Client) SendMessage(message *MessageRequest) (*Message, error)

Specs: https://core.telegram.org/bots/api#sendmessage

type InlineKeyboard added in v2.0.48

type InlineKeyboard struct {
	InlineKeyboard []InlineKeyboardRow `json:"inline_keyboard"`
}

type InlineKeyboardButton added in v2.0.48

type InlineKeyboardButton struct {
	Text string `json:"text"`
	URL  string `json:"url,omitempty"`
}

type InlineKeyboardRow added in v2.0.48

type InlineKeyboardRow []*InlineKeyboardButton

type Message added in v2.0.48

type Message struct {
	MessageID       int64 `json:"message_id"`
	From            User  `json:"from"`
	Chat            Chat  `json:"chat"`
	MessageThreadID int64 `json:"message_thread_id"`
	Date            int64 `json:"date"`
}

type MessageRequest added in v2.0.48

type MessageRequest struct {
	ChatID                string          `json:"chat_id"`
	MessageThreadID       int64           `json:"message_thread_id,omitempty"`
	Text                  string          `json:"text"`
	ParseMode             string          `json:"parse_mode,omitempty"`
	DisableWebPagePreview bool            `json:"disable_web_page_preview"`
	DisableNotification   bool            `json:"disable_notification"`
	ReplyMarkup           *InlineKeyboard `json:"reply_markup,omitempty"`
}

type MessageResponse added in v2.0.48

type MessageResponse struct {
	BaseResponse
	Result Message `json:"result"`
}

type User added in v2.0.48

type User 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"`
	IsPremium               bool   `json:"is_premium"`
	CanJoinGroups           bool   `json:"can_join_groups"`
	CanReadAllGroupMessages bool   `json:"can_read_all_group_messages"`
	SupportsInlineQueries   bool   `json:"supports_inline_queries"`
}

type UserResponse added in v2.0.48

type UserResponse struct {
	BaseResponse
	Result User `json:"result"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL