utils

package
v0.38.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ChannelChatID      telego.ChatID
	GroupChatID        telego.ChatID
	BotUsername        string
	IsChannelAvailable bool
)

Functions

func FindSourceURLForMessage

func FindSourceURLForMessage(message *telego.Message) string

func GetArtworkHTMLCaption

func GetArtworkHTMLCaption(artwork *types.Artwork) string

func GetArtworkPostMessageURL

func GetArtworkPostMessageURL(messageID int, channelChatID telego.ChatID) string

func GetDeepLinkForFile

func GetDeepLinkForFile(pictureID string, botUsername string) string

func GetMessageIDs

func GetMessageIDs(messages []telego.Message) []int

func GetMessageOriginChannelArtworkPost

func GetMessageOriginChannelArtworkPost(ctx context.Context, bot *telego.Bot, message telego.Message) (*telego.MessageOriginChannel, bool)
检查目标消息是否为频道的作品消息

如果是,返回 messageOriginChannel 和 true

func GetMessagePhotoFileBytes

func GetMessagePhotoFileBytes(bot *telego.Bot, message *telego.Message) ([]byte, error)

func GetMssageOriginChannel

func GetMssageOriginChannel(_ context.Context, _ *telego.Bot, message telego.Message) *telego.MessageOriginChannel

func GetPicturePreviewInputFile

func GetPicturePreviewInputFile(ctx context.Context, picture *types.Picture) (inputFile *telego.InputFile, needUpdatePreview bool, err error)

func GetPostedPictureInlineKeyboardButton

func GetPostedPictureInlineKeyboardButton(artwork *types.Artwork, index uint, channelChatID telego.ChatID, botUsername string) []telego.InlineKeyboardButton

func GetPostedPictureReplyMarkup

func GetPostedPictureReplyMarkup(artwork *types.Artwork, index uint, channelChatID telego.ChatID, botUsername string) *telego.InlineKeyboardMarkup

func Init

func Init(channelChatID, groupChatID telego.ChatID, botUsername string)

func PostAndCreateArtwork

func PostAndCreateArtwork(ctx context.Context, artwork *types.Artwork, bot *telego.Bot, fromID int64, messageID int) error

func PostArtwork

func PostArtwork(ctx context.Context, bot *telego.Bot, artwork *types.Artwork) ([]telego.Message, error)

func ReplyMessage

func ReplyMessage(bot *telego.Bot, message telego.Message, text string) (*telego.Message, error)

func ReplyMessageWithHTML

func ReplyMessageWithHTML(bot *telego.Bot, message telego.Message, text string) (*telego.Message, error)

func ReplyMessageWithMarkdown

func ReplyMessageWithMarkdown(bot *telego.Bot, message telego.Message, text string) (*telego.Message, error)

func SendArtworkInfo

func SendArtworkInfo(ctx context.Context, bot *telego.Bot, params *SendArtworkInfoParams) error

func SendPictureFileByID

func SendPictureFileByID(ctx context.Context, bot *telego.Bot, message telego.Message, channelChatID telego.ChatID, pictureID string) (*telego.Message, error)

Types

type SendArtworkInfoParams

type SendArtworkInfoParams struct {
	ChatID        *telego.ChatID
	SourceURL     string
	AppendCaption string
	Verify        bool
	HasPermission bool
	IgnoreDeleted bool
	ReplyParams   *telego.ReplyParameters
}

Jump to

Keyboard shortcuts

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