setting

package
v0.26.3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// 是否启用内置机器人
	BotEnable = true
	// 是否仅已注册级别以上的群可以使用机器人
	WhiteLimit1 = false
	// 是否仅已注册级别以上的用户可以使用机器人
	WhiteLimit2 = false
	// 未注册指令时响应的内容,仅对"/"开头的指令有效
	InvalidHandler = "-"
	// 是否自动同意新的好友请求
	FriendAccept = true
	// 添加好友后的响应内容,留空则忽略
	FriendHello = "群主去修仙了,请留言"
	// 自动下载消息中的图片
	AutoSaveImage = true
	// 群聊撤回消息时响应的内容,留空则忽略
	RevokeMsg = "撤回了"
	// 用户和群默认使用的模型
	ModelDefault = ""
	// 定义模型扮演的身份
	ModelContext = "你是由 OpenTDP 开发的群助手,必须使用尽可能少的字数回答接下来的所有问题"
	// 模型历史消息数
	ModelHistory = 20
	// API 指令请求的后端网址
	ApiEndpoint = "https://wrest.rehi.org/"
	// API 指令卡片使用的图标
	ApiEndpointIcon = "https://wrest.rehi.org/assets/icon.png"
	// HELP 指令扩展内容
	HelpAdditive = ""
)

Functions

func Count

func Count(data *CountParam) (int64, error)

func Create

func Create(data *CreateParam) (uint, error)

func DataMigrate

func DataMigrate()

func Delete

func Delete(data *DeleteParam) error

func Fetch

func Fetch(data *FetchParam) (*tables.Setting, error)

func FetchAll

func FetchAll(data *FetchAllParam) ([]*tables.Setting, error)

func Laod

func Laod()

func Replace

func Replace(data *ReplaceParam) error

func Update

func Update(data *UpdateParam) error

Types

type CountParam

type CountParam = FetchAllParam

type CreateParam

type CreateParam struct {
	Rd     uint   `json:"rd"`
	Name   string `json:"name" binding:"required"`
	Type   string `json:"type"`
	Group  string `json:"group"`
	Value  string `json:"value"`
	Title  string `json:"title"`
	Remark string `json:"remark"`
}

type DeleteParam

type DeleteParam = FetchParam

type FetchAllParam

type FetchAllParam struct {
	Group string `json:"group"`
}

type FetchParam

type FetchParam struct {
	Rd   uint   `json:"rd"`
	Name string `json:"name"`
}

type ReplaceParam

type ReplaceParam = CreateParam

type UpdateParam

type UpdateParam = CreateParam

Jump to

Keyboard shortcuts

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