chore(qq_napcat): rewrite all napcat_bridge logic into this project to replace adapt into napcat_bridge
This commit is contained in:
@@ -31,6 +31,12 @@ func LoadConfig(configPath string) (*Config, error) {
|
||||
if cfg.ControllerMethod.QQ.ListenMethod == "" {
|
||||
cfg.ControllerMethod.QQ.ListenMethod = "global"
|
||||
}
|
||||
if cfg.ControllerMethod.QQ.NapcatAddr == "" {
|
||||
cfg.ControllerMethod.QQ.NapcatAddr = "127.0.0.1"
|
||||
}
|
||||
if cfg.ControllerMethod.QQ.NapcatPort == "" {
|
||||
cfg.ControllerMethod.QQ.NapcatPort = "3000"
|
||||
}
|
||||
if cfg.ControllerMethod.QQ.Admins == nil {
|
||||
cfg.ControllerMethod.QQ.Admins = []string{}
|
||||
}
|
||||
|
||||
+11
-2
@@ -7,6 +7,13 @@ type SystemConfig struct {
|
||||
ListenPort string `json:"listenPort"`
|
||||
}
|
||||
|
||||
// DebugConfig holds debug-level configuration.
|
||||
type DebugConfig struct {
|
||||
ShowNapcatMsg bool `json:"showNapcatMsg"`
|
||||
ShowNapcatAction bool `json:"showNapcatAction"`
|
||||
ShowTelegramMsg bool `json:"showTelegramMsg"`
|
||||
}
|
||||
|
||||
// KomariAccount holds Komari login credentials.
|
||||
type KomariAccount struct {
|
||||
Username string `json:"username"`
|
||||
@@ -22,8 +29,9 @@ type KomariConfig struct {
|
||||
// QQConfig holds QQ (Napcat) Bot controller configuration.
|
||||
type QQConfig struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
URL string `json:"url"`
|
||||
Token string `json:"token"`
|
||||
NapcatAddr string `json:"napcatAddr"`
|
||||
NapcatPort string `json:"napcatPort"`
|
||||
NapcatToken string `json:"napcatToken"`
|
||||
BotQQID int64 `json:"botQQID"`
|
||||
ListenMethod string `json:"listenMethod"`
|
||||
Admins []string `json:"admins"`
|
||||
@@ -88,6 +96,7 @@ type ControllerMessageConfig struct {
|
||||
// Config is the top-level application configuration.
|
||||
type Config struct {
|
||||
System SystemConfig `json:"system"`
|
||||
Debug DebugConfig `json:"debug"`
|
||||
Komari KomariConfig `json:"komari"`
|
||||
ControllerMethod ControllerMethodConfig `json:"controllerMethod"`
|
||||
ControllerMessage ControllerMessageConfig `json:"controllerMessage"`
|
||||
|
||||
Reference in New Issue
Block a user