This commit is contained in:
cdle
2023-06-06 20:14:51 +08:00
parent 10f300626a
commit e9a82789d8
4 changed files with 78 additions and 15 deletions
+7 -7
View File
@@ -67,13 +67,13 @@ var BotsLocker sync.RWMutex
var ErrNotFind = errors.New("adapter not find")
func DestroyAdapterByUUID(uuid string) {
BotsLocker.RLock()
defer BotsLocker.RUnlock()
for i := range Bots {
if Bots[i].uuid == uuid {
go Bots[i].Destroy()
}
}
// BotsLocker.RLock()
// defer BotsLocker.RUnlock()
// for i := range Bots {
// if Bots[i].uuid == uuid {
// go Bots[i].Destroy()
// }
// }
}
func GetAdapter(botplt string, bots_id ...string) (*Factory, error) {
+5
View File
@@ -9,6 +9,7 @@ import (
"strings"
"github.com/cdle/sillyplus/emoji"
"github.com/cdle/sillyplus/utils"
)
type Strings struct {
@@ -201,3 +202,7 @@ func (sender *Strings) ReplaceToEmojis(str string, pattern string) string {
func (sender *Strings) ExtractAddress(input string) string {
return regexp.MustCompile(`http[s]?://[\w.]+:?\d*`).FindString(input)
}
func (sender *Strings) Unique(str ...interface{}) []string {
return utils.Unique(str...)
}
+1 -1
View File
@@ -81,7 +81,7 @@ func publicScript(str string) string {
if su.GetValue("title") == "" {
su.SetValue("title", "无名脚本")
}
if su.GetValue("message") == "" {
if su.GetValue("message") != "" {
su.DeleteValue("message")
}
create_at := su.GetValue("create_at")