telegram

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(
	botToken, channelID string,
) *Client

func (*Client) SendTextMessage

func (s *Client) SendTextMessage(ctx context.Context, title, text, url string) error

func (*Client) SendTextMessageRaw

func (s *Client) SendTextMessageRaw(ctx context.Context, smr SendMessageReq) error

func (*Client) VerifyPermission

func (s *Client) VerifyPermission(ctx context.Context) error

type Config

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

type LinkPreviewOptions

type LinkPreviewOptions struct {
	IsDisabled    bool `json:"is_disabled"`
	ShowAboveText bool `json:"show_above_text"`
}

type SendMessageReq

type SendMessageReq struct {
	ChatID             string             `json:"chat_id"`
	ParseMode          string             `json:"parse_mode"`
	Text               string             `json:"text"`
	LinkPreviewOptions LinkPreviewOptions `json:"link_preview_options"`
}

type SendMessageResp

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

type TelegramVerifyResp

type TelegramVerifyResp struct {
	Ok          bool   `json:"ok"`
	ErrorCode   int    `json:"error_code,omitempty"`
	Description string `json:"description,omitempty"`

	Result struct {
		Status          string `json:"status"`
		CanPostMessages bool   `json:"can_post_messages"`
	} `json:"result"`
}

Jump to

Keyboard shortcuts

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