tg

package
v0.0.0-...-64046f9 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BotToMTProtoID

func BotToMTProtoID(id int64) int64

BotToMTProtoID Bot to MTProto ID.

func EscapeMD

func EscapeMD(txt string) string

EscapeMD escapes all markdown reserved chars.

func IsBotIsNotMember

func IsBotIsNotMember(err error) bool

func IsBotIsNotMemberOfChannel

func IsBotIsNotMemberOfChannel(err error) bool

func IsBotIsNotMemberOfSupergroup

func IsBotIsNotMemberOfSupergroup(err error) bool

func IsCantCheckChatMember

func IsCantCheckChatMember(err error) bool

func IsChatNotFoundError

func IsChatNotFoundError(err error) bool

func IsMemberListIsInaccessible

func IsMemberListIsInaccessible(err error) bool
func IsNotEnoughRightsToExportChatInviteLink(err error) bool

func MTProtoToBotID

func MTProtoToBotID(id int32) int64

MTProtoToBotID converts MTProto to Bot ID

func ParseJoinLink(v string) string

ParseJoinLink returns hash from join chat link or empty string if not found.

Types

type ChatInputType

type ChatInputType int
const (
	ChatInputUnkown ChatInputType = iota
	ChatInputJoinLink
	ChatInputUsername
)

func ParseChatInput

func ParseChatInput(query string) (qt ChatInputType, value string)

ParseChatInput parse user input

type Handler

type Handler interface {
	HandleUpdate(ctx context.Context, update *tgbotapi.Update) error
}

type HandlerFunc

type HandlerFunc func(ctx context.Context, update *tgbotapi.Update) error

func (HandlerFunc) HandleUpdate

func (hf HandlerFunc) HandleUpdate(ctx context.Context, update *tgbotapi.Update) error

type JoinLinkPayload

type JoinLinkPayload struct {
	CreatorID int32
	ChatID    int32
	RandomID  int64
}

func DecodeJoinLinkPayload

func DecodeJoinLinkPayload(encodedPayload string) (*JoinLinkPayload, error)

func (*JoinLinkPayload) BotChatID

func (payload *JoinLinkPayload) BotChatID() int64

type Middleware

type Middleware func(next Handler) Handler

Jump to

Keyboard shortcuts

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