config

package
v0.0.0-...-05c6761 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BotID string
)

Functions

func ComposeWebUIURL

func ComposeWebUIURL(useBackupPort bool) string

ComposeWebUIURL 组合webui的完整访问地址 参数 useBackupPort 控制是否使用备用端口

func ComposeWebUIURLv2

func ComposeWebUIURLv2(useBackupPort bool) string

ComposeWebUIURLv2 组合webui的完整访问地址 参数 useBackupPort 控制是否使用备用端口

func DeleteConfig

func DeleteConfig() error

DeleteConfig 删除配置文件并创建一个新的配置文件模板

func GetAddAtGroup

func GetAddAtGroup() bool

获取GetAddAtGroup的值

func GetAlias

func GetAlias() []string

获取Alias的值

func GetAliyunAccessKeyId

func GetAliyunAccessKeyId() string

GetAliyunAccessKeyId 获取阿里云OSS的AccessKeyId

func GetAliyunAccessKeySecret

func GetAliyunAccessKeySecret() string

GetAliyunAccessKeySecret 获取阿里云OSS的AccessKeySecret

func GetAliyunAudit

func GetAliyunAudit() bool

获取GetAliyunAudit的值

func GetAliyunBucketName

func GetAliyunBucketName() string

GetAliyunBucketName 获取阿里云OSS的AliyunBucketName

func GetAliyunEndpoint

func GetAliyunEndpoint() string

获取阿里云的oss地址 外网的

func GetArrayValue

func GetArrayValue() bool

获取Array的值

func GetAtoPCount

func GetAtoPCount() int

获取GetAtoPCount的值

func GetAutoBind

func GetAutoBind() bool

获取GetAutoBind的值

func GetBackupPort

func GetBackupPort() string

GetLotusPort retrieves the LotusPort setting from your singleton instance.

func GetBaiduAudit

func GetBaiduAudit() int

获取BaiduAudit

func GetBaiduBCEAK

func GetBaiduBCEAK() string

获取BaiduBCEAK

func GetBaiduBCESK

func GetBaiduBCESK() string

获取BaiduBCESK

func GetBaiduBOSBucketName

func GetBaiduBOSBucketName() string

获取BaiduBOSBucketName

func GetBindPrefix

func GetBindPrefix() string

获取GetBindPrefix的值

func GetBlackPrefixMode

func GetBlackPrefixMode() bool

获取黑名单开启状态

func GetBlackPrefixs

func GetBlackPrefixs() []string

获取黑名单指令数组

func GetCardAndNick

func GetCardAndNick() string

获取GetCardAndNick的值

func GetCrtPath

func GetCrtPath() string

获取crt路径

func GetCustomBotName

func GetCustomBotName() string

获取GetCustomBotName的值

func GetDevBotid

func GetDevBotid() string

获取DevBotid

func GetDevMsgID

func GetDevMsgID() bool

获取GetDevMsgID的值

func GetDevelop_Acdir

func GetDevelop_Acdir() string

获取Develop_Acdir服务的地址

func GetDeveloperLog

func GetDeveloperLog() bool

开发者日志

func GetEnableWsServer

func GetEnableWsServer() bool

获取port的值

func GetForwardMsgLimit

func GetForwardMsgLimit() int

获取GetForwardMsgLimit

func GetGlobalChannelToGroup

func GetGlobalChannelToGroup() bool

func GetGuildUrlImageToBase64

func GetGuildUrlImageToBase64() bool

获取GetGuildUrlImageToBase64的值

func GetHashIDValue

func GetHashIDValue() bool

获取HashID

func GetHeartBeatInterval

func GetHeartBeatInterval() int

获取GetHeartBeatInterval的值

func GetHttpAddress

func GetHttpAddress() string

获取 HTTP 地址

func GetHttpTimeOut

func GetHttpTimeOut() int

获取 HTTP 超时时间

func GetHttpVersion

func GetHttpVersion() int

获取 HTTP 版本

func GetIdentifyFile

func GetIdentifyFile() bool

获取identify_file的值

func GetIdmapPro

func GetIdmapPro() bool

获取GetIdmapPro的值

func GetIgnoreBotMessage

func GetIgnoreBotMessage() bool

func GetImageLimit

func GetImageLimit() int

GetImageLimit 返回 ImageLimit 的值

func GetImageLimitB

func GetImageLimitB() int

获取ImageLimitB的值

func GetKeyPath

func GetKeyPath() string

获取key路径

func GetLaunchReconectTimes

func GetLaunchReconectTimes() int

获取LaunchReconectTimes

func GetLazyMessageId

func GetLazyMessageId() bool

获取LazyMessageId状态

func GetLogLevel

func GetLogLevel() int

获取GetSaveLogs的值

func GetLotusPassword

func GetLotusPassword() string

获取GetLotusPassword的值

func GetLotusValue

func GetLotusValue() bool

获取lotus的值

func GetMasterID

func GetMasterID() []string

获取MasterID数组

func GetMePrefix

func GetMePrefix() string

获取GetMePrefix的值

func GetNativeOb11

func GetNativeOb11() bool

获取GetTransferUrl的值

func GetNoWhiteResponse

func GetNoWhiteResponse() string

获取NoWhiteResponse的值

func GetOb11Int32

func GetOb11Int32() bool

func GetOssType

func GetOssType() int

获取 Oss 模式

func GetPortValue

func GetPortValue() string

获取port的值

func GetPostMaxRetries

func GetPostMaxRetries() []int

获取 POST 最大重试次数数组

func GetPostRetriesInterval

func GetPostRetriesInterval() []int

获取 POST 重试间隔数组

func GetPostSecret

func GetPostSecret() []string

获取 POST 密钥数组

func GetPostUrl

func GetPostUrl() []string

获取 POST URL 数组

func GetQrSize

func GetQrSize() int

获取GetQrSize的值

func GetRamDomSeq

func GetRamDomSeq() bool

获取GetRamDomSeq的值

func GetReconnecTimes

func GetReconnecTimes() int

获取GetReconnecTimes的值

func GetRecordBitRate

func GetRecordBitRate() int

GetRecordBitRate 返回 RecordBitRate

func GetRecordSampleRate

func GetRecordSampleRate() int

GetRecordSampleRate 返回 RecordSampleRate的值

func GetRegionID

func GetRegionID() string

GetRegionID 从 AliyunEndpoint 获取 regionId

func GetRemoveAt

func GetRemoveAt() bool

获取RemoveAt的值

func GetRemoveBotAtGroup

func GetRemoveBotAtGroup() bool

获取GetRemoveBotAtGroup的值

func GetRemovePrefixValue

func GetRemovePrefixValue() bool

GetRemovePrefixValue 函数用于获取 remove_prefix 的配置值

func GetRestartTime

func GetRestartTime() int

获取 RestartTime 模式

func GetSaveLogs

func GetSaveLogs() bool

获取GetSaveLogs的值

func GetSelfIntroduce

func GetSelfIntroduce() []string

获取SelfIntroduce的值

func GetSendDelay

func GetSendDelay() int

获取send_delay的值

func GetSendError

func GetSendError() bool

获取GetSendError的值

func GetServerUserName

func GetServerUserName() string

GetServerUserName 获取服务器用户名

func GetServerUserPassword

func GetServerUserPassword() string

GetServerUserPassword 获取服务器用户密码

func GetServer_dir

func GetServer_dir() string

获取gensokyo-kook服务的地址

func GetTencentAudit

func GetTencentAudit() bool

获取GetTencentAudit的值

func GetTencentBucketURL

func GetTencentBucketURL() string

GetTencentBucketURL 获取 TencentBucketURL

func GetTencentCosSecretid

func GetTencentCosSecretid() string

GetTencentCosSecretid 获取 TencentCosSecretid

func GetTencentSecretKey

func GetTencentSecretKey() string

GetTencentSecretKey 获取 TencentSecretKey

func GetTransferUrl

func GetTransferUrl() bool

获取GetTransferUrl的值

func GetTwoWayEcho

func GetTwoWayEcho() bool

获取双向ehco

func GetUnlockPrefix

func GetUnlockPrefix() string

获取GetUnlockPrefix

func GetUrlPicTransfer

func GetUrlPicTransfer() bool

获取GetUrlPicTransfer的值

func GetUrlToQrimage

func GetUrlToQrimage() bool

获取GetUrlToQrimage的值

func GetVisibleIP

func GetVisibleIP() bool

获取IPurl显示开启状态

func GetWhiteBypass

func GetWhiteBypass() []int64

获取白名单例外群数组

func GetWhiteBypassRevers

func GetWhiteBypassRevers() bool

获取GetWhiteBypassRevers的值

func GetWhiteEnable

func GetWhiteEnable(index int) bool

获取WhiteEnable的值

func GetWhitePrefixMode

func GetWhitePrefixMode() bool

获取白名单开启状态

func GetWhitePrefixs

func GetWhitePrefixs() []string

获取白名单指令数组

func GetWsAddress

func GetWsAddress() []string

获取ws地址数组

func GetWsServerPath

func GetWsServerPath() string

获取GetWsServerPath的值

func GetWsServerToken

func GetWsServerToken() string

获取WsServerToken的值

func GetWsToken

func GetWsToken() []string

获取WsToken

func UpdateConfig

func UpdateConfig(conf *Config, path string) error

UpdateConfig 将配置写入文件

func WriteYAMLToFile

func WriteYAMLToFile(yamlContent string) error

WriteYAMLToFile 将YAML格式的字符串写入到指定的文件路径

Types

type Config

type Config struct {
	Version  int      `yaml:"version"`
	Settings Settings `yaml:"settings"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig 从文件中加载配置并初始化单例配置

type Settings

type Settings struct {
	WsAddress              []string             `yaml:"ws_address"`
	AppID                  uint64               `yaml:"app_id"`
	Token                  string               `yaml:"token"`
	ClientSecret           string               `yaml:"client_secret"`
	TextIntent             []string             `yaml:"text_intent"`
	GlobalChannelToGroup   bool                 `yaml:"global_channel_to_group"`
	GlobalPrivateToChannel bool                 `yaml:"global_private_to_channel"`
	Array                  bool                 `yaml:"array"`
	Server_dir             string               `yaml:"server_dir"`
	Lotus                  bool                 `yaml:"lotus"`
	Port                   string               `yaml:"port"`
	RestartTime            int                  `yaml:"restart_time"`
	WsToken                []string             `yaml:"ws_token,omitempty"`         // 连接wss时使用,不是wss可留空 一一对应
	MasterID               []string             `yaml:"master_id,omitempty"`        // 如果需要在群权限判断是管理员是,将user_id填入这里,master_id是一个文本数组
	EnableWsServer         bool                 `yaml:"enable_ws_server,omitempty"` //正向ws开关
	WsServerToken          string               `yaml:"ws_server_token,omitempty"`  //正向ws token
	IdentifyFile           bool                 `yaml:"identify_file"`              // 域名校验文件
	Crt                    string               `yaml:"crt"`
	Key                    string               `yaml:"key"`
	DeveloperLog           bool                 `yaml:"developer_log"`
	Username               string               `yaml:"server_user_name"`
	Password               string               `yaml:"server_user_password"`
	ImageLimit             int                  `yaml:"image_sizelimit"`
	RemovePrefix           bool                 `yaml:"remove_prefix"`
	BackupPort             string               `yaml:"backup_port"`
	DevlopAcDir            string               `yaml:"develop_access_token_dir"`
	RemoveAt               bool                 `yaml:"remove_at"`
	DevBotid               string               `yaml:"develop_bot_id"`
	SandBoxMode            bool                 `yaml:"sandbox_mode"`
	Title                  string               `yaml:"title"`
	HashID                 bool                 `yaml:"hash_id"`
	TwoWayEcho             bool                 `yaml:"twoway_echo"`
	LazyMessageId          bool                 `yaml:"lazy_message_id"`
	WhitePrefixMode        bool                 `yaml:"white_prefix_mode"`
	WhitePrefixs           []string             `yaml:"white_prefixs"`
	BlackPrefixMode        bool                 `yaml:"black_prefix_mode"`
	BlackPrefixs           []string             `yaml:"black_prefixs"`
	VisualPrefixs          []VisualPrefixConfig `yaml:"visual_prefixs"`
	VisibleIp              bool                 `yaml:"visible_ip"`
	ForwardMsgLimit        int                  `yaml:"forward_msg_limit"`
	DevMessgeID            bool                 `yaml:"dev_message_id"`
	LogLevel               int                  `yaml:"log_level"`
	SaveLogs               bool                 `yaml:"save_logs"`
	BindPrefix             string               `yaml:"bind_prefix"`
	MePrefix               string               `yaml:"me_prefix"`
	RemoveBotAtGroup       bool                 `yaml:"remove_bot_at_group"`
	ImageLimitB            int                  `yaml:"image_limit"`
	RecordSampleRate       int                  `yaml:"record_sampleRate"`
	RecordBitRate          int                  `yaml:"record_bitRate"`
	NoWhiteResponse        string               `yaml:"No_White_Response"`
	SendError              bool                 `yaml:"send_error"`
	AddAtGroup             bool                 `yaml:"add_at_group"`
	UrlPicTransfer         bool                 `yaml:"url_pic_transfer"`
	LotusPassword          string               `yaml:"lotus_password"`
	WsServerPath           string               `yaml:"ws_server_path"`
	IdmapPro               bool                 `yaml:"idmap_pro"`
	CardAndNick            string               `yaml:"card_nick"`
	AutoBind               bool                 `yaml:"auto_bind"`
	CustomBotName          string               `yaml:"custom_bot_name"`
	SendDelay              int                  `yaml:"send_delay"`
	AtoPCount              int                  `yaml:"AMsgRetryAsPMsg_Count"`
	ReconnecTimes          int                  `yaml:"reconnect_times"`
	HeartBeatInterval      int                  `yaml:"heart_beat_interval"`
	LaunchReconectTimes    int                  `yaml:"launch_reconnect_times"`
	UnlockPrefix           string               `yaml:"unlock_prefix"`
	WhiteBypass            []int64              `yaml:"white_bypass"`
	TransferUrl            bool                 `yaml:"transfer_url"`
	HttpAddress            string               `yaml:"http_address"`
	HttpVersion            int                  `yaml:"http_version"`
	HttpTimeOut            int                  `yaml:"http_timeout"`
	PostUrl                []string             `yaml:"post_url"`
	PostSecret             []string             `yaml:"post_secret"`
	PostMaxRetries         []int                `yaml:"post_max_retries"`
	PostRetriesInterval    []int                `yaml:"post_retries_interval"`
	NativeOb11             bool                 `yaml:"native_ob11"`
	RamDomSeq              bool                 `yaml:"ramdom_seq"`
	UrlToQrimage           bool                 `yaml:"url_to_qrimage"`
	QrSize                 int                  `yaml:"qr_size"`
	WhiteBypassRevers      bool                 `yaml:"white_bypass_reverse"`
	GuildUrlImageToBase64  bool                 `yaml:"guild_url_image_to_base64"`
	TencentBucketName      string               `yaml:"t_COS_BUCKETNAME"`
	TencentBucketRegion    string               `yaml:"t_COS_REGION"`
	TencentCosSecretid     string               `yaml:"t_COS_SECRETID"`
	TencentSecretKey       string               `yaml:"t_COS_SECRETKEY"`
	TencentAudit           bool                 `yaml:"t_audit"`
	OssType                int                  `yaml:"oss_type"`
	BaiduBOSBucketName     string               `yaml:"b_BOS_BUCKETNAME"`
	BaiduBCEAK             string               `yaml:"b_BCE_AK"`
	BaiduBCESK             string               `yaml:"b_BCE_SK"`
	BaiduAudit             int                  `yaml:"b_audit"`
	AliyunEndpoint         string               `yaml:"a_OSS_EndPoint"`
	AliyunAccessKeyId      string               `yaml:"a_OSS_AccessKeyId"`
	AliyunAccessKeySecret  string               `yaml:"a_OSS_AccessKeySecret"`
	AliyunBucketName       string               `yaml:"a_OSS_BucketName"`
	AliyunAudit            bool                 `yaml:"a_audit"`
	Alias                  []string             `yaml:"alias"`
	SelfIntroduce          []string             `yaml:"self_introduce"`
	WhiteEnable            []bool               `yaml:"white_enable"`
	KaiheilaApi            string               `yaml:"kaiheila_api"`
	Ob11Int32              bool                 `yaml:"ob11_int32"`
	IgnoreBotMessage       bool                 `yaml:"ignore_bot_message"`
}

type VisualPrefixConfig

type VisualPrefixConfig struct {
	Prefix          string   `yaml:"prefix"`
	WhiteList       []string `yaml:"whiteList"`
	NoWhiteResponse string   `yaml:"No_White_Response"`
}

func GetVisualkPrefixs

func GetVisualkPrefixs() []VisualPrefixConfig

修改 GetVisualkPrefixs 函数以返回新类型

Jump to

Keyboard shortcuts

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