tgbotwok

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FallbackLanguageCode = telegrambot.LanguageCodeEnglish

Functions

func CompileCbQryData

func CompileCbQryData(command, args string) string

Compiles callback data in command-args type

func DecompileCbQryData

func DecompileCbQryData(cbQryData string) (command, args string)

Decompiles callback data in command-args type

func DeepLinkAddContact

func DeepLinkAddContact(params *DeepLinkAddContactParameters) string

func DeepLinkAddStickers

func DeepLinkAddStickers(params *DeepLinkAddStickersParameters) string

func DeepLinkAddTheme

func DeepLinkAddTheme(params *DeepLinkAddThemeParameters) string

func DeepLinkBg

func DeepLinkBg(params *DeepLinkBgParameters) string

func DeepLinkCall

func DeepLinkCall(params *DeepLinkCallParameters) string

func DeepLinkCallLog

func DeepLinkCallLog() string

func DeepLinkConfirmPhone

func DeepLinkConfirmPhone(params *DeepLinkConfirmPhoneParameters) string

func DeepLinkJoin

func DeepLinkJoin(params *DeepLinkJoinParameters) string

func DeepLinkLogin

func DeepLinkLogin(params *DeepLinkLoginParameters) string

func DeepLinkMsgURL

func DeepLinkMsgURL(params *DeepLinkMsgURLParameters) string

func DeepLinkNeedUpdateForSomeFeature

func DeepLinkNeedUpdateForSomeFeature() string

func DeepLinkPassport

func DeepLinkPassport(params *DeepLinkPassportParameters) string

func DeepLinkPrivatePost

func DeepLinkPrivatePost(params *DeepLinkPrivatePostParameters) string

func DeepLinkProxy

func DeepLinkProxy(params *DeepLinkProxyParameters) string

func DeepLinkResolve

func DeepLinkResolve(params *DeepLinkResolveParameters) string

func DeepLinkScanQR

func DeepLinkScanQR() string

func DeepLinkSearch

func DeepLinkSearch(params *DeepLinkSearchParameters) string

func DeepLinkSetLanguage

func DeepLinkSetLanguage() string

func DeepLinkSettings

func DeepLinkSettings(params *DeepLinkSettingsParams) string

func DeepLinkShareGameScore

func DeepLinkShareGameScore(params *DeepLinkShareGameScoreParameters) string

func DeepLinkSocks

func DeepLinkSocks(params *DeepLinkSocksParameters) string

func DeepLinkSomeUnsupportedFeature

func DeepLinkSomeUnsupportedFeature() string

func DeepLinkStatsRefresh

func DeepLinkStatsRefresh() string

Something related to getStatsURL, probably not implemented yet

func DeepLinkTON

func DeepLinkTON(domain string, method string, fields url.Values) string
func DeepLinkToTMeLink(str string) string

Does not works with all deep links, for example with username links

func DeepLinkUser

func DeepLinkUser(params *DeepLinkUserParameters) string

Bot API only

func LinkChannel

func LinkChannel(username telegrambot.Username, postid telegrambot.MessageID) string

func LinkChannelPost

func LinkChannelPost(username telegrambot.Username, postid telegrambot.MessageID) string

func LinkPhoneNumber

func LinkPhoneNumber(phoneNumber string) string

func LinkTelescope

func LinkTelescope(username telegrambot.Username, postid telegrambot.MessageID) string

func LinkUsername

func LinkUsername(username telegrambot.Username) string

func ParseMessageCommand

func ParseMessageCommand(msg *telegrambot.Message) (command string, args string)

func StartChatAction

func StartChatAction(api telegrambot.API, params *telegrambot.SendChatActionParameters) (cancel func(), err error)

Types

type DeepLinkAddContactParameters

type DeepLinkAddContactParameters struct {
	Name  string `url:"name,omitempty"`
	Phone string `url:"phone,omitempty"`
}

type DeepLinkAddStickersParameters

type DeepLinkAddStickersParameters struct {
	Set telegrambot.StickerSetName `url:"set,omitempty"`
}

type DeepLinkAddThemeParameters

type DeepLinkAddThemeParameters struct {
	Slug string `url:"slug,omitempty"`
}

type DeepLinkBgParameters

type DeepLinkBgParameters struct {
	// wallpaper
	Slug string `url:"slug,omitempty"`
	// blur+motion
	Mode      string `url:"mode,omitempty"`
	Color     string `url:"color,omitempty"`
	BgColor   string `url:"bg_color,omitempty"`
	Rotation  string `url:"rotation,omitempty"`
	Intensity string `url:"intensity,omitempty"`
}

type DeepLinkCallParameters

type DeepLinkCallParameters struct {
	Format string `url:"format,omitempty"`
	Name   string `url:"name,omitempty"`
	Phone  string `url:"phone,omitempty"`
}

type DeepLinkConfirmPhoneParameters

type DeepLinkConfirmPhoneParameters struct {
	Phone string `url:"phone,omitempty"`
	Hash  string `url:"hash,omitempty"`
}

type DeepLinkJoinParameters

type DeepLinkJoinParameters struct {
	Invite string `url:"invite,omitempty"`
}

type DeepLinkLoginParameters

type DeepLinkLoginParameters struct {
	Token string `url:"token,omitempty"`
	Code  string `url:"code,omitempty"`
}

type DeepLinkMsgURLParameters

type DeepLinkMsgURLParameters struct {
	// URL to be shared
	URL string `url:"url,omitempty"`
	// Optional. Text on the next line in message with url to be shared
	Text string `url:"text,omitempty"`
}

type DeepLinkPassportParameters

type DeepLinkPassportParameters struct {
	Scope       string             `url:"scope,omitempty"`
	Nonce       string             `url:"nonce,omitempty"`
	Payload     string             `url:"payload,omitempty"`
	BotID       telegrambot.UserID `url:"bot_id,omitempty"`
	PublicKey   string             `url:"public_key,omitempty"`
	CallbackURL string             `url:"callback_url,omitempty"`
}

type DeepLinkPrivatePostParameters

type DeepLinkPrivatePostParameters struct {
	Channel telegrambot.ChatID    `url:"channel,omitempty"`
	Post    telegrambot.MessageID `url:"post,omitempty"`
	Thread  telegrambot.MessageID `url:"thread,omitempty"`
	Comment telegrambot.MessageID `url:"comment,omitempty"`
}

type DeepLinkProxyParameters

type DeepLinkProxyParameters struct {
	// Server address (ip or domain)
	Server string `url:"server,omitempty"`
	// Server port
	Port int `url:"port,omitempty"`
	// MTProto credentials
	Secret string `url:"secret,omitempty"`
}

type DeepLinkResolveParameters

type DeepLinkResolveParameters struct {
	// Target username
	Domain telegrambot.Username `url:"domain,omitempty"`
	// Start parameters for private chat with bot
	Start string `url:"start,omitempty"`
	// Start parameters for selected chat with bot
	Startgroup string `url:"startgroup,omitempty"`
	// Game short name
	Game telegrambot.GameShortName `url:"game,omitempty"`
	// Message id
	Post telegrambot.MessageID `url:"post,omitempty"`
	// Thread message id
	Thread telegrambot.MessageID `url:"thread,omitempty"`
	// Thread Comment message id
	Comment telegrambot.MessageID `url:"comment,omitempty"`

	BotID       telegrambot.UserID `url:"bot_id,omitempty"`
	PublicKey   string             `url:"public_key,omitempty"`
	CallbackURL string             `url:"callback_url,omitempty"`
	Nonce       string             `url:"nonce,omitempty"`
	Payload     string             `url:"payload,omitempty"`
	Scope       string             `url:"scope,omitempty"`
}

type DeepLinkSearchParameters

type DeepLinkSearchParameters struct {
	Query string `url:"query,omitempty"`
}

type DeepLinkSettingsParams

type DeepLinkSettingsParams struct {
	Themes       string `url:"themes,omitempty"`
	Devices      string `url:"devices,omitempty"`
	Folders      string `url:"folders,omitempty"`
	Language     string `url:"language,omitempty"`
	ChangeNumber string `url:"change_number,omitempty"`
	Privacy      string `url:"privacy,omitempty"`
}

type DeepLinkShareGameScoreParameters

type DeepLinkShareGameScoreParameters struct {
	Hash string `url:"hash,omitempty"`
}

type DeepLinkSocksParameters

type DeepLinkSocksParameters struct {
	// Server address (ip or domain)
	Server string `url:"server,omitempty"`
	// Server port
	Port int `url:"port,omitempty"`
	// User for server
	User string `url:"user,omitempty"`
	// Password for user
	Pass string `url:"pass,omitempty"`
}

type DeepLinkUserParameters

type DeepLinkUserParameters struct {
	ID telegrambot.UserID `url:"id,omitempty"`
}

type LocaleHTML

type LocaleHTML[ExecData any] map[telegrambot.LanguageCode]*templatehtml.Template

func NewLocaleHTML

func NewLocaleHTML[ExecData any](patterns map[telegrambot.LanguageCode]string) (LocaleHTML[ExecData], error)

func NewMustLocaleHTML

func NewMustLocaleHTML[ExecData any](patterns map[telegrambot.LanguageCode]string) LocaleHTML[ExecData]

func (LocaleHTML[ExecData]) Execute

func (lh LocaleHTML[ExecData]) Execute(lc telegrambot.LanguageCode, data ExecData) (string, error)

func (LocaleHTML[ExecData]) MustExecute

func (lh LocaleHTML[ExecData]) MustExecute(lc telegrambot.LanguageCode, data ExecData) string

func (LocaleHTML[ExecData]) String

func (lh LocaleHTML[ExecData]) String(lc telegrambot.LanguageCode) string

type LocaleText

type LocaleText[ExecData any] map[telegrambot.LanguageCode]*templatetext.Template

func NewLocaleText

func NewLocaleText[ExecData any](patterns map[telegrambot.LanguageCode]string) (LocaleText[ExecData], error)

func NewMustLocaleText

func NewMustLocaleText[ExecData any](patterns map[telegrambot.LanguageCode]string) LocaleText[ExecData]

func (LocaleText[ExecData]) Execute

func (lt LocaleText[ExecData]) Execute(lc telegrambot.LanguageCode, data ExecData) (string, error)

func (LocaleText[ExecData]) MustExecute

func (lt LocaleText[ExecData]) MustExecute(lc telegrambot.LanguageCode, data ExecData) string

func (LocaleText[ExecData]) String

func (lt LocaleText[ExecData]) String(lc telegrambot.LanguageCode) string

type ReplyKeyboardHandler

type ReplyKeyboardHandler [][]ReplyKeyboardHandlerButton

func (ReplyKeyboardHandler) HandleMessageKeyboardButton

func (rkh ReplyKeyboardHandler) HandleMessageKeyboardButton(msg *telegrambot.Message) (handled bool, err error)

func (ReplyKeyboardHandler) ReplyMarkup

func (rkh ReplyKeyboardHandler) ReplyMarkup() telegrambot.ReplyMarkup

func (ReplyKeyboardHandler) ReplyMarkupWithOptions

func (rkh ReplyKeyboardHandler) ReplyMarkupWithOptions(options telegrambot.ReplyKeyboardMarkup) telegrambot.ReplyMarkup

type ReplyKeyboardHandlerButton

type ReplyKeyboardHandlerButton struct {
	Text    string
	Handler func() error
}

Jump to

Keyboard shortcuts

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