first commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/cdle/sillyplus/utils"
|
||||
)
|
||||
|
||||
var platforms = []string{}
|
||||
|
||||
func init() {
|
||||
nickname.Foreach(func(b1, b2 []byte) error {
|
||||
v := &Nickname{}
|
||||
err := json.Unmarshal(b2, v)
|
||||
if err == nil {
|
||||
platforms = append(platforms, v.Platform)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
platforms = utils.Unique(platforms)
|
||||
}
|
||||
|
||||
func getPltsArray() []string {
|
||||
return utils.Unique(platforms, GetAdapterBotPlts())
|
||||
}
|
||||
|
||||
func getPltsLabel() []map[string]string {
|
||||
ms := []map[string]string{}
|
||||
for _, v := range getPltsArray() {
|
||||
ms = append(ms, map[string]string{"label": v, "value": v})
|
||||
}
|
||||
return ms
|
||||
}
|
||||
Reference in New Issue
Block a user