tgutil

package
v0.44.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCancelButton

func BuildCancelButton(taskID string) tg.KeyboardButtonClass

func ChatIdFromPeer added in v0.35.0

func ChatIdFromPeer(peer tg.PeerClass) int64

func ExtFromContext

func ExtFromContext(ctx context.Context) *ext.Context

func ExtWithContext

func ExtWithContext(ctx context.Context, extCtx *ext.Context) context.Context

func ExtractMessageEntityUrls added in v0.33.0

func ExtractMessageEntityUrls(msg *tg.Message) []string

func ExtractMessageEntityUrlsText added in v0.33.0

func ExtractMessageEntityUrlsText(msg *tg.Message) string

func GenFileNameFromMessage

func GenFileNameFromMessage(message tg.Message) string

generate a file name from the message content and media type

it will never return an empty string

func GetGroupedMessages added in v0.24.0

func GetGroupedMessages(ctx *ext.Context, chatID int64, msg *tg.Message) ([]*tg.Message, error)

func GetMediaFileName added in v0.28.0

func GetMediaFileName(media tg.MessageMediaClass) (string, error)

func GetMessageByID

func GetMessageByID(ctx *ext.Context, chatID int64, msgID int) (*tg.Message, error)

f**k gotgproto's breaking changes

func GetMessagesRange

func GetMessagesRange(ctx *ext.Context, chatID int64, minId, maxId int) ([]*tg.Message, error)

func InputMessageClassSliceFromInt

func InputMessageClassSliceFromInt(ids []int) []tg.InputMessageClass

func NewConfigProxyResolver added in v0.40.0

func NewConfigProxyResolver() (dcs.Resolver, error)

func ParseChatID

func ParseChatID(ctx *ext.Context, idOrUsername string) (int64, error)
func ParseMessageLink(ctx *ext.Context, link string) (int64, int, error)

return: ChatID, MessageID, error

Types

This section is empty.

Jump to

Keyboard shortcuts

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