12345678910111213141516171819202122232425262728293031323334 |
- package public
- import (
- "strings"
- "github.com/eryajf/chatgpt-dingtalk/config"
- "github.com/eryajf/chatgpt-dingtalk/pkg/cache"
- )
- var UserService cache.UserServiceInterface
- var Config *config.Configuration
- var Prompt *[]config.Prompt
- func InitSvc() {
- Config = config.LoadConfig()
- Prompt = config.LoadPrompt()
- UserService = cache.NewUserService()
- _, _ = GetBalance()
- }
- func FirstCheck(rmsg ReceiveMsg) bool {
- lc := UserService.GetUserMode(rmsg.SenderStaffId)
- if lc == "" {
- if Config.DefaultMode == "串聊" {
- return true
- } else {
- return false
- }
- }
- if lc != "" && strings.Contains(lc, "串聊") {
- return true
- }
- return false
- }
|