Versions in this module Expand all Collapse all v1 v1.0.2 May 30, 2025 Changes in this version + var AlbumListTemplate = database.TemplateVersion + var BotAppID = "cli_a570c2871fe3500e" + var BotOpenID = "ou_8817f540f718affd21718f415b81597f" + var FourColSheetTemplate = database.TemplateVersion + var FullLyricsCardPattern = ... + var FullLyricsTemplate = database.TemplateVersion + var LarkClient *lark.Client = lark.NewClient(env.LarkAppID, env.LarkAppSecret) + var MusicCardPattern = ... + var NormalCardGraphReplyTemplate = database.TemplateVersion + var NormalCardReplyTemplate = database.TemplateVersion + var SingleSongDetailTemplate = database.TemplateVersion + var StreamingReasonTemplate = database.TemplateVersion + var ThreeColSheetTemplate = database.TemplateVersion + var TwoColPicTemplate = database.TemplateVersion + var TwoColSheetTemplate = database.TemplateVersion + func AddReaction(ctx context.Context, reactionType, msgID string) (reactionID string, err error) + func AddReaction2DB(ctx context.Context, msgID string) + func AddReactionAsync(ctx context.Context, reactionType, msgID string) (err error) + func CheckFunctionEnabling(chatID string, function consts.LarkFunctionEnum) bool + func CreateMsgText(ctx context.Context, content, msgID, chatID string) (err error) + func CreateMsgTextRaw(ctx context.Context, content, msgID, chatID string) (err error) + func DownImgFromMsgAsync(ctx context.Context, msgID, fileType, fileKey string) (err error) + func DownImgFromMsgSync(ctx context.Context, msgID, fileType, fileKey string) (url string, err error) + func GenFullLyricsCard(ctx context.Context, title, artist, leftLyrics, rightLyrics string) string + func GenUUIDStr(str string, length int) string + func GenerateMusicCard(imgKey, title, artist, playURL, lyrics string) string + func GenerateMusicCardByStruct(ctx context.Context, imgKey, title, artist, playURL, lyrics, musicID string) string + func GetAllImageFromMsgEvent(ctx context.Context, message *larkim.EventMessage) (imageKeys iter.Seq[string], err error) + func GetAllImgTagFromMsg(ctx context.Context, message *larkim.Message) (imageKeys iter.Seq[string], err error) + func GetAllImgURLFromMsg(ctx context.Context, msgID string) (iter.Seq[string], error) + func GetAllImgURLFromParent(ctx context.Context, data *larkim.P2MessageReceiveV1) (iter.Seq[string], error) + func GetAndResizePicFromURL(ctx context.Context, imageURL string) (res []byte, err error) + func GetChatIDFromMsgID(ctx context.Context, msgID string) (chatID string, err error) + func GetChatName(ctx context.Context, chatID string) (chatName string) + func GetCommand(ctx context.Context, content string) (commands []string) + func GetCommandWithMatched(ctx context.Context, content string) (commands []string, isCommand bool) + func GetMsgByID(ctx context.Context, msgID string) string + func GetMsgFullByID(ctx context.Context, msgID string) *larkim.GetMessageResp + func GetMsgImages(ctx context.Context, msgID, fileKey, fileType string) (file io.Reader, err error) + func GetRandomEmoji() string + func GetTemplate(template database.TemplateVersion) database.TemplateVersion + func GetTenantAccessToken(ctx context.Context) string + func GetUserMapFromChatID(ctx context.Context, chatID string) (memberMap map[string]*larkim.ListMember, err error) + func GetUserMemberFromChat(ctx context.Context, chatID, openID string) (member *larkim.ListMember, err error) + func IsCommand(ctx context.Context, content string) bool + func IsMentioned(mentions []*larkim.MentionEvent) bool + func PreGetTextMsg(ctx context.Context, event *larkim.P2MessageReceiveV1) string + func ReBuildArgs(argName, argValue string) string + func RecordMessage2Opensearch(ctx context.Context, resp *larkim.CreateMessageResp, contents ...string) + func RecordReplyMessage2Opensearch(ctx context.Context, resp *larkim.ReplyMessageResp, contents ...string) + func RecoverMsg(ctx context.Context, msgID string) + func RecoverMsgEvent(ctx context.Context, event *larkim.P2MessageReceiveV1) + func RemoveReaction(ctx context.Context, reactionID, msgID string) (err error) + func ReplyCard(ctx context.Context, cardContent *TemplateCardContent, msgID, suffix string, ...) (err error) + func ReplyCardText(ctx context.Context, text string, msgID, suffix string, replyInThread bool) (err error) + func ReplyCardTextGraph(ctx context.Context, text string, graph any, msgID, suffix string, ...) (err error) + func ReplyMsgRawContentType(ctx context.Context, msgID, msgType, content, suffix string, ...) (resp *larkim.ReplyMessageResp, err error) + func ReplyMsgText(ctx context.Context, text, msgID, suffix string, replyInThread bool) (resp *larkim.ReplyMessageResp, err error) + func SendEphemeral(ctx context.Context, chatID, openID, card string) + func SendRecoveredMsg(ctx context.Context, err any, msgID string) + func TrimAtMsg(ctx context.Context, msg string) string + func TrimLyrics(lyrics string) string + func Upload2Lark(ctx context.Context, musicID string, bodyReader io.ReadCloser) (imgKey string, err error) + func UploadPicAllinOne(ctx context.Context, imageURL, musicID string, uploadOSS bool) (key string, ossURL string, err error) + func UploadPicBatch(ctx context.Context, sourceURLIDs map[string]int) chan [2]string + func UploadPicture2Lark(ctx context.Context, URL string) (imgKey string) + func UploadPicture2LarkReader(ctx context.Context, picture io.Reader) (imgKey string) + type CardData struct + TemplateID string + TemplateSrc string + TemplateVariable map[string]interface{} + TemplateVersionName string + type EphemeralCardReqBody struct + Card interface{} + ChatID string + MsgType string + OpenID string + type TemplateCardContent struct + Data CardData + Type string + func NewCardContent(ctx context.Context, template database.TemplateVersion) *TemplateCardContent + func (c *TemplateCardContent) AddJaegerTraceInfo(traceID string) *TemplateCardContent + func (c *TemplateCardContent) AddVariable(key string, value interface{}) *TemplateCardContent + func (c *TemplateCardContent) BuildTemplate() string + func (c *TemplateCardContent) GetVariables() []string + func (c *TemplateCardContent) String() string + func (c *TemplateCardContent) UpdateVariables(m map[string]interface{}) *TemplateCardContent + type TemplateStru struct + TemplateID string + TemplateVersion string + type TextBuilder struct + func NewTextMsgBuilder() *TextBuilder + func (t *TextBuilder) AtUser(userId, name string) *TextBuilder + func (t *TextBuilder) Build() string + func (t *TextBuilder) Text(text string) *TextBuilder