Documentation
¶
Index ¶
- func ArtworkHTMLCaption(artwork shared.ArtworkLike) string
- func ArtworkInputMedias(ctx context.Context, serv *service.Service, meta *metautil.MetaData, ...) (*ioutil.Closer[[]telego.InputMedia], error)
- func ArtworkPostKeyboard(meta *metautil.MetaData, cbId string) [][]telego.InlineKeyboardButton
- func CheckPermissionForQuery(ctx context.Context, serv *service.Service, query telego.CallbackQuery, ...) bool
- func CheckPermissionInGroup(ctx context.Context, serv *service.Service, message telego.Message, ...) bool
- func CreateArtworkInfoReplyMarkup(ctx context.Context, meta *metautil.MetaData, serv *service.Service, ...) (*telego.InlineKeyboardMarkup, error)
- func EscapeHTML(s string) string
- func FindSourceURLInMessage(serv *service.Service, message *telego.Message) string
- func GetMediaInputMedia(ctx context.Context, serv *service.Service, meta *metautil.MetaData, ...) (*ioutil.Closer[telego.InputMedia], error)
- func GetMessagePhotoFile(ctx *telegohandler.Context, message *telego.Message) ([]byte, error)
- func GetMssageOriginChannel(message *telego.Message) *telego.MessageOriginChannel
- func GetPictureDocumentInputFile(ctx context.Context, serv *service.Service, meta *metautil.MetaData, ...) (*ioutil.Closer[telego.InputFile], error)
- func GetPicturePhotoInputFile(ctx context.Context, serv *service.Service, meta *metautil.MetaData, ...) (*ioutil.Closer[telego.InputFile], error)
- func GetPostedArtworkInlineKeyboardButton(artwork *entity.Artwork, meta *metautil.MetaData) []telego.InlineKeyboardButton
- func GetUgoiraVideoDocumentInputFile(ctx context.Context, serv *service.Service, meta *metautil.MetaData, ...) (*ioutil.Closer[telego.InputFile], error)
- func GetUgoiraVideoInputFile(ctx context.Context, serv *service.Service, meta *metautil.MetaData, ...) (*ioutil.Closer[telego.InputFile], error)
- func GetVideoDocumentInputFile(ctx context.Context, serv *service.Service, meta *metautil.MetaData, ...) (*ioutil.Closer[telego.InputFile], error)
- func GetVideoVideoInputFile(ctx context.Context, serv *service.Service, meta *metautil.MetaData, ...) (*ioutil.Closer[telego.InputFile], error)
- func ParseCommandBy(text string, splitChar, quoteChar string) (string, string, []string)
- func PostAndCreateArtwork(ctx context.Context, bot *telego.Bot, serv *service.Service, ...) error
- func ReplyMessage(ctx *telegohandler.Context, message telego.Message, text string) (*telego.Message, error)
- func ReplyMessageWithHTML(ctx *telegohandler.Context, message telego.Message, text string) (*telego.Message, error)
- func SendArtworkInfo(ctx context.Context, bot *telego.Bot, meta *metautil.MetaData, ...) error
- func UpdateCachedArtworkFileID(ctx context.Context, results []MediaGroupResultMessage, serv *service.Service, ...) error
- type ArtworkCaptionData
- type CreateArtworkInfoReplyMarkupOptions
- type MediaGroupResultMessage
- type MediaItem
- type MediaResultType
- type SendArtworkInfoOptions
- type SendOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArtworkHTMLCaption ¶
func ArtworkHTMLCaption(artwork shared.ArtworkLike) string
func ArtworkInputMedias ¶ added in v1.5.0
func ArtworkInputMedias( ctx context.Context, serv *service.Service, meta *metautil.MetaData, artwork shared.ArtworkLike, caption string, items []MediaItem, start, end int, ) (*ioutil.Closer[[]telego.InputMedia], error)
ArtworkInputMedias creates input medias from MediaItems (supports mixed photos and videos)
func ArtworkPostKeyboard ¶
func ArtworkPostKeyboard(meta *metautil.MetaData, cbId string) [][]telego.InlineKeyboardButton
func CheckPermissionForQuery ¶
func CheckPermissionForQuery(ctx context.Context, serv *service.Service, query telego.CallbackQuery, permissions ...shared.Permission) bool
func CheckPermissionInGroup ¶
func CreateArtworkInfoReplyMarkup ¶
func CreateArtworkInfoReplyMarkup(ctx context.Context, meta *metautil.MetaData, serv *service.Service, artwork shared.ArtworkLike, controls *CreateArtworkInfoReplyMarkupOptions) (*telego.InlineKeyboardMarkup, error)
func EscapeHTML ¶ added in v1.8.1
func FindSourceURLInMessage ¶
func GetMediaInputMedia ¶ added in v1.5.0
func GetMediaInputMedia(ctx context.Context, serv *service.Service, meta *metautil.MetaData, artwork shared.ArtworkLike, media shared.MediaLike) (*ioutil.Closer[telego.InputMedia], error)
MediaLike 转换为对应的 InputMedia
第一个 Media 意为 MediaLike, 第二个 Media 意为tg的 MediaInputFile
func GetMessagePhotoFile ¶
func GetMssageOriginChannel ¶
func GetMssageOriginChannel(message *telego.Message) *telego.MessageOriginChannel
func GetUgoiraVideoInputFile ¶ added in v1.5.0
func GetVideoDocumentInputFile ¶ added in v1.5.0
func GetVideoVideoInputFile ¶ added in v1.5.0
func ParseCommandBy ¶
func PostAndCreateArtwork ¶
func ReplyMessage ¶
func ReplyMessageWithHTML ¶
func SendArtworkInfo ¶
func SendArtworkInfo(ctx context.Context, bot *telego.Bot, meta *metautil.MetaData, serv *service.Service, sourceUrl string, chatID telego.ChatID, opts SendArtworkInfoOptions) error
将作品信息附带操作按钮发送到指定聊天, 用于提供给管理员发布或修改作品
需要区分已发布的作品, 已标记为删除的作品, 和未发布的作品
func UpdateCachedArtworkFileID ¶ added in v1.4.0
func UpdateCachedArtworkFileID(ctx context.Context, results []MediaGroupResultMessage, serv *service.Service, meta *metautil.MetaData, artwork *entity.CachedArtworkData) error
Types ¶
type ArtworkCaptionData ¶
type MediaGroupResultMessage ¶
type MediaGroupResultMessage struct {
Message telego.Message
FileID string // Telegram file ID
Type MediaResultType
Index int
}
type MediaItem ¶ added in v1.5.0
type MediaItem struct {
Picture shared.PictureLike
Ugoira shared.UgoiraMetaLike
Video shared.VideoLike
TelegramInfo shared.TelegramInfo
Type MediaResultType
Index int // original index in pictures, ugoiras or videos array
}
MediaItem represents a photo, ugoira or video for unified processing
type MediaResultType ¶ added in v1.5.0
type MediaResultType uint
const ( MediaResultTypePhoto MediaResultType = iota + 1 MediaResultTypeUgoira MediaResultTypeVideo // although ugoira is also be sent as video, we need to distinguish them for file ID update purposes )
type SendArtworkInfoOptions ¶
type SendArtworkInfoOptions struct {
ReplyParameters *telego.ReplyParameters
AppendCaption string
HasPermission bool
}
type SendOption ¶
type SendOption struct {
ReplyTo int
}
Click to show internal directories.
Click to hide internal directories.