Help us shape the future of Go! Take the 2026 Go Developer Survey

handlers

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: MIT Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MuteRedisKeyPrefix = "mute:"
)

Variables

This section is empty.

Functions

func ChatHandler

func ChatHandler(chatType string) func(ctx context.Context, event *larkim.P2MessageReceiveV1, args ...string) (err error)

func ChatHandlerInner

func ChatHandlerInner(ctx context.Context, event *larkim.P2MessageReceiveV1, chatType string, size *int, args ...string) (err error)

func DebugGetGroupIDHandler

func DebugGetGroupIDHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) error

DebugGetGroupIDHandler to be filled

@param ctx context.Context
@param data *larkim.P2MessageReceiveV1
@param args ...string
@return error
@author heyuhengmatt
@update 2024-08-06 08:27:29

func DebugGetIDHandler

func DebugGetIDHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) error

DebugGetIDHandler to be filled

@param ctx context.Context
@param data *larkim.P2MessageReceiveV1
@param args ...string
@return error
@author heyuhengmatt
@update 2024-08-06 08:27:33

func DebugImageHandler

func DebugImageHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) error

func DebugRepeatHandler

func DebugRepeatHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) error

func DebugRevertHandler

func DebugRevertHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) error

DebugRevertHandler DebugTraceHandler to be filled

@param ctx context.Context
@param data *larkim.P2MessageReceiveV1
@param args ...string
@return error

func DebugTraceHandler

func DebugTraceHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) error

DebugTraceHandler to be filled

@param ctx context.Context
@param data *larkim.P2MessageReceiveV1
@param args ...string
@return error
@author heyuhengmatt
@update 2024-08-06 08:27:23

func DebugTryPanicHandler

func DebugTryPanicHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) error

DebugTryPanicHandler to be filled

@param ctx context.Context
@param data *larkim.P2MessageReceiveV1
@param args ...string
@return error
@author heyuhengmatt
@update 2024-08-06 08:27:25

func FilterMessage

func FilterMessage(hits []opensearchapi.SearchHit, size int) (msgList []string)

func GenerateChatSeq

func GenerateChatSeq(ctx context.Context, event *larkim.P2MessageReceiveV1, modelID string, size *int, files []string, input ...string) (res iter.Seq[*doubao.ModelStreamRespReasoning], err error)

func GetTraceFromMsgID

func GetTraceFromMsgID(ctx context.Context, msgID string) (iter.Seq[*traceItem], error)

GetTraceFromMsgID to be filled

@param ctx context.Context
@param msgID string
@return []string
@return error
@author heyuhengmatt
@update 2024-08-06 08:27:37

func GoldHandler

func GoldHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) (err error)

func ImageAddHandler

func ImageAddHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) error

ImageAddHandler to be filled

@param ctx context.Context
@param data *larkim.P2MessageReceiveV1
@param args ...string
@return error
@author heyuhengmatt
@update 2024-08-06 08:27:13

func ImageDelHandler

func ImageDelHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) (err error)

ImageDelHandler to be filled

@param ctx context.Context
@param data *larkim.P2MessageReceiveV1
@param args ...string
@return error

func ImageGetHandler

func ImageGetHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) error

ImageGetHandler to be filled

@param ctx context.Context
@param data *larkim.P2MessageReceiveV1
@param args ...string
@return error

func ImitateHandler

func ImitateHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) (err error)

func MusicSearchHandler

func MusicSearchHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) (err error)

func MuteHandler

func MuteHandler(ctx context.Context, event *larkim.P2MessageReceiveV1, args ...string) (err error)

func OneWordHandler

func OneWordHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) (err error)

func ReplyAddHandler

func ReplyAddHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) error

ReplyAddHandler to be filled

@param ctx context.Context
@param data *larkim.P2MessageReceiveV1
@param args ...string
@return error
@author heyuhengmatt
@update 2024-08-06 08:27:18

func ReplyGetHandler

func ReplyGetHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) error

ReplyGetHandler to be filled

@param ctx context.Context
@param data *larkim.P2MessageReceiveV1
@param args ...string
@return error

func SearchByUserID

func SearchByUserID(UserID string, batch, size uint64) (messageList []string)

func SearchExcludeUserID

func SearchExcludeUserID(UserID, chatID string, batch, size uint64) (messageList []string)

func StatsGetHandler

func StatsGetHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) (err error)

func StockHandler

func StockHandler(stockType string) commandBase.CommandFunc[*larkim.P2MessageReceiveV1]

func TrendHandler

func TrendHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) (err error)

TrendHandler to be filled

@param ctx context.Context
@param data *larkim.P2MessageReceiveV1
@param args ...string
@return err error
@author kevinmatthe
@update 2025-05-30 15:19:56

func WordAddHandler

func WordAddHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) error

WordAddHandler to be filled

@param ctx context.Context
@param data *larkim.P2MessageReceiveV1
@param args ...string
@return error
@author heyuhengmatt
@update 2024-08-06 08:27:09

func WordGetHandler

func WordGetHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) error

WordGetHandler to be filled

@param ctx context.Context
@param data *larkim.P2MessageReceiveV1
@param args ...string
@return error
@author heyuhengmatt
@update 2024-08-06 08:27:07

Types

type Mention

type Mention struct {
	Key string `json:"key"`
	ID  struct {
		UserID  string `json:"user_id"`
		OpenID  string `json:"open_id"`
		UnionID string `json:"union_id"`
	} `json:"id"`
	Name      string `json:"name"`
	TenantKey string `json:"tenant_key"`
}

type MessageDoc

type MessageDoc struct {
	UserID     string `json:"user_id"`
	ChatID     string `json:"chat_id"`
	UserName   string `json:"user_name"`
	Mentions   string `json:"mentions"`
	RawMessage string `json:"raw_message"`
	CreateTime string `json:"create_time"`
}

type RespBody

type RespBody struct {
	ID         int         `json:"id"`
	UUID       string      `json:"uuid"`
	Hitokoto   string      `json:"hitokoto"`
	Type       string      `json:"type"`
	From       string      `json:"from"`
	FromWho    interface{} `json:"from_who"`
	Creator    string      `json:"creator"`
	CreatorUID int         `json:"creator_uid"`
	Reviewer   int         `json:"reviewer"`
	CommitFrom string      `json:"commit_from"`
	CreatedAt  string      `json:"created_at"`
	Length     int         `json:"length"`
}

RespBody 一言返回体

Jump to

Keyboard shortcuts

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