Documentation
¶
Index ¶
- Variables
- func CheckIsAdmin(userID string) (isAdmin bool)
- func FindByCache[T any](model T) (modelList []T, hitCache bool)
- func FindByCacheFunc[T any](model T, keyFunc func(T) string) (res []T, hitCache bool)
- func FindFuncNoCache[T any](model T) (res []T)
- func GetAdminLevel(userID string) int
- func GetDbConnection() *gorm.DB
- type Administrator
- type AlertList
- type ChannelLogExt
- type ChatContextRecord
- type ChatRecordLog
- type CommandInfo
- type CopyWritingCustom
- type CopyWritingGeneral
- type DynamicConfig
- type FunctionEnabling
- type General
- type GeneralConf
- type ImitateRateCustom
- type InteractionStats
- type LarkImg
- type MsgTraceLog
- type PromptConf
- type PromptTemplateArgs
- type QuoteReplyMsg
- type QuoteReplyMsgCustom
- type ReactImageMeterial
- type ReactionWhitelist
- type RepeatWhitelist
- type RepeatWordsRate
- type RepeatWordsRateCustom
- type ReplyNType
- type StickerMapping
- type TemplateVersion
Constants ¶
This section is empty.
Variables ¶
GlobalCache 全局缓存
Functions ¶
func FindByCacheFunc ¶
FindByCacheFunc 查找缓存
@param model T @param f func(T) string @return modelList []T @return hitCache bool @author heyuhengmatt @update 2024-07-17 06:36:14
func FindFuncNoCache ¶
func FindFuncNoCache[T any](model T) (res []T)
Types ¶
type Administrator ¶
type Administrator struct {
gorm.Model
UserID int64 `json:"user_id" gorm:"primaryKey"`
UserName string `json:"user_name"`
Level int64 `json:"level"`
}
Administrator is the struct of administrator
type AlertList ¶
type AlertList struct {
EmailAddress string
}
AlertList is the struct of alert config
type ChannelLogExt ¶
type ChannelLogExt struct {
UserID string `json:"user_id" gorm:"primaryKey"`
UserName string `json:"user_name"`
ChannelID string `json:"channel_id" gorm:"primaryKey"`
ChannelName string `json:"channel_name"`
JoinedTime string `json:"joined_time" gorm:"primaryKey"`
LeftTime string `json:"left_time"`
ISUpdate bool `json:"is_update"`
MsgID string `json:"msg_id"`
GuildID string `json:"guild_id" `
}
ChannelLogExt is the struct of channel log
func (*ChannelLogExt) AddJoinedRecord ¶
func (cl *ChannelLogExt) AddJoinedRecord() error
AddJoinedRecord 添加加入记录
@receiver cl @return error
func (*ChannelLogExt) UpdateLeftTime ¶
func (cl *ChannelLogExt) UpdateLeftTime() (newChanLog *ChannelLogExt, err error)
UpdateLeftTime 更新离开时间
@receiver cl @return error
type ChatContextRecord ¶
type ChatContextRecord struct {
UserID string `json:"user_id"`
SessionID string `json:"session_id"`
}
ChatContextRecord is
type ChatRecordLog ¶
type ChatRecordLog struct {
AuthorID string `json:"user_id" gorm:"primaryKey"`
RecordStr string `json:"record_str"`
}
ChatRecordLog 存储chat的对话记录
type CommandInfo ¶
type CommandInfo struct {
CommandName string `json:"command_name" gorm:"primaryKey;autoIncrement:false"`
CommandDesc string `json:"command_desc"`
CommandParamLen int `json:"command_param_len"`
CommandType string `json:"command_type"`
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
}
CommandInfo is the struct of command info
func GetCommandInfo ¶
func GetCommandInfo(command string) (commandInfoList []*CommandInfo, err error)
GetCommandInfo 获取命令信息
@param command @return info
func GetCommandInfoWithOpt ¶
func GetCommandInfoWithOpt(optionf string) (commandInfoList []*CommandInfo, err error)
GetCommandInfoWithOpt 获取命令信息
@param option @return info
type CopyWritingCustom ¶
type CopyWritingCustom struct {
Endpoint string `json:"endpoint" gorm:"primaryKey;autoIncrement:false"`
GuildID string `json:"guild_id" gorm:"primaryKey;autoIncrement:false"`
Content pq.StringArray `gorm:"type:text[]" json:"content"`
}
type CopyWritingGeneral ¶
type CopyWritingGeneral struct {
Endpoint string `json:"endpoint" gorm:"primaryKey;autoIncrement:false"`
Content pq.StringArray `gorm:"type:text[]" json:"content"`
}
type DynamicConfig ¶
type DynamicConfig struct {
Key string `json:"key" gorm:"primaryKey"`
Value string `json:"value" gorm:"primaryKey"`
}
DynamicConfig is the struct of dynamic command info
type FunctionEnabling ¶
type FunctionEnabling struct {
GuildID string `json:"guild_id" gorm:"primaryKey;autoIncrement:false"`
Function consts.LarkFunctionEnum `json:"function" gorm:"primaryKey;autoIncrement:false"`
}
type GeneralConf ¶
type ImitateRateCustom ¶
type InteractionStats ¶
type LarkImg ¶
type LarkImg struct {
gorm.Model
SongID string `json:"song_id" gorm:"primaryKey;autoIncrement:false"`
ImgKey string `json:"img_key" gorm:"primaryKey;autoIncrement:false"`
}
LarkImg is
type MsgTraceLog ¶
type PromptConf ¶
type PromptTemplateArgs ¶
type PromptTemplateArgs struct {
PromptID int `json:"prompt_id" gorm:"primaryKey;autoIncrement:false"`
TemplateStr string `json:"template_str"`
Task string `json:"task"`
HistoryRecords []string `json:"history_records" gorm:"-"`
Constraints string `json:"constraints"`
UserInput []string `json:"user_input" gorm:"-"`
}
type QuoteReplyMsg ¶
type QuoteReplyMsg struct {
MatchType consts.WordMatchType `json:"match_type" gorm:"primaryKey;index;default:substr"`
Keyword string `json:"keyword" gorm:"primaryKey;index"`
ReplyNType
}
type QuoteReplyMsgCustom ¶
type QuoteReplyMsgCustom struct {
GuildID string `json:"guil d_id" gorm:"primaryKey;index"`
MatchType consts.WordMatchType `json:"match_type" gorm:"primaryKey;index;default:substr"`
Keyword string `json:"keyword" gorm:"primaryKey;index"`
ReplyNType
}
type ReactImageMeterial ¶
type ReactionWhitelist ¶
type ReactionWhitelist struct {
GuildID string `json:"guild_id" gorm:"primaryKey;autoIncrement:false"`
}
type RepeatWhitelist ¶
type RepeatWhitelist struct {
GuildID string `json:"guild_id" gorm:"primaryKey;autoIncrement:false"`
}
type RepeatWordsRate ¶
type RepeatWordsRateCustom ¶
type ReplyNType ¶
type StickerMapping ¶
Click to show internal directories.
Click to hide internal directories.