forked from FloatTech/ZeroBot-Plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
60 lines (47 loc) · 1.59 KB
/
main.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package main
import (
"github.com/ssp97/ZeroBot-Plugin/app"
"github.com/ssp97/ZeroBot-Plugin/conf"
"github.com/ssp97/ZeroBot-Plugin/pkg/dbManager"
"net/http"
_ "net/http/pprof"
// 注:以下插件均可通过前面加 // 注释,注释后停用并不加载插件
// 下列插件可与 wdvxdr1123/ZeroBot v1.1.2 以上配合单独使用
// 词库类
_ "github.com/ssp97/ZeroBot-Plugin/app/atri" // ATRI词库
_ "github.com/ssp97/ZeroBot-Plugin/app/chat" // 基础词库
// 实用类
_ "github.com/ssp97/ZeroBot-Plugin/app/runcode" // 在线运行代码
// 娱乐类
_ "github.com/ssp97/ZeroBot-Plugin/app/ai_false" // 服务器监控
// 二次元图片
_ "github.com/ssp97/ZeroBot-Plugin/app/image_finder" // 关键字搜图
_ "github.com/ssp97/ZeroBot-Plugin/app/lolicon" // lolicon 随机图片
_ "github.com/ssp97/ZeroBot-Plugin/app/saucenao" // 以图搜图
_ "github.com/ssp97/ZeroBot-Plugin/app/jieba" // 分词
log "github.com/sirupsen/logrus"
easy "github.com/t-tomalak/logrus-easy-formatter"
)
var content = []string{
"* ChatBot + ZeroBot + Golang ",
"* Project: https://github.com/ssp97/ZeroBot-app",
}
func init() {
log.SetFormatter(&easy.Formatter{
TimestampFormat: "2006-01-02 15:04:05",
LogFormat: "[zero][%time%][%lvl%]: %msg% \n",
})
log.SetLevel(log.DebugLevel)
go http.ListenAndServe("0.0.0.0:6060", nil)
}
func main() {
if err := conf.Init(); err != nil {
log.Error(" conf init err: %v", err)
panic(err)
}
db := dbManager.New(&conf.Conf.DB)
dbManager.SetDb(dbManager.DEFAULT_DB_NAME, db)
app.Init(conf.Conf)
//pgweb.Init()
select {}
}