x
This commit is contained in:
+7
-7
@@ -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) {
|
||||
|
||||
@@ -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...)
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user