forked from FloatTech/ZeroBot-Plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.go
44 lines (36 loc) · 932 Bytes
/
init.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Package kanban 打印版本信息
package kanban
import (
"fmt"
"github.com/FloatTech/zbputils/control"
"github.com/fumiama/go-registry"
"github.com/FloatTech/ZeroBot-Plugin/kanban/banner"
)
//go:generate go run github.com/FloatTech/ZeroBot-Plugin/kanban/gen
func init() {
PrintBanner()
}
var reg = registry.NewRegReader("reilia.fumiama.top:32664", control.Md5File, "fumiama")
// PrintBanner ...
func PrintBanner() {
fmt.Print(
"\n======================[ZeroBot-Plugin]======================",
"\n", banner.Banner, "\n",
"----------------------[ZeroBot-公告栏]----------------------",
"\n", Kanban(), "\n",
"============================================================\n\n",
)
}
// Kanban ...
func Kanban() string {
err := reg.Connect()
if err != nil {
return err.Error()
}
defer reg.Close()
text, err := reg.Get("ZeroBot-Plugin/kanban")
if err != nil {
return err.Error()
}
return text
}