🔖✏️ 添加注释

This commit is contained in:
Kanri 2021-07-02 19:20:55 +08:00
parent 5a327a550f
commit eb08d29e3d

39
main.go
View File

@ -3,6 +3,7 @@ package main
import ( import (
"fmt" "fmt"
"os" "os"
"strings"
// 注:以下插件均可通过前面加 // 注释,注释后停用并不加载插件 // 注:以下插件均可通过前面加 // 注释,注释后停用并不加载插件
// 下列插件可与 wdvxdr1123/ZeroBot v1.1.2 以上配合单独使用 // 下列插件可与 wdvxdr1123/ZeroBot v1.1.2 以上配合单独使用
@ -40,6 +41,13 @@ import (
easy "github.com/t-tomalak/logrus-easy-formatter" easy "github.com/t-tomalak/logrus-easy-formatter"
) )
var content = []string{
"* OneBot + ZeroBot + Golang ",
"* Version 1.0.4 - 2021-07-02 19:14:58.581489207 +0800 CST",
"* Copyright © 2020 - 2021 Kanri, DawnNights, Fumiama ",
"* Project: https://github.com/FloatTech/ZeroBot-Plugin",
}
func init() { func init() {
log.SetFormatter(&easy.Formatter{ log.SetFormatter(&easy.Formatter{
TimestampFormat: "2006-01-02 15:04:05", TimestampFormat: "2006-01-02 15:04:05",
@ -49,34 +57,35 @@ func init() {
} }
func main() { func main() {
fmt.Print(` fmt.Print(
====================[ZeroBot-Plugin]==================== "====================[ZeroBot-Plugin]====================",
* OneBot + ZeroBot + Golang "\n", strings.Join(content, "\n"), "\n",
* Version 1.0.3 - 2021-05-02 18:50:40.5489203 +0800 CST "========================================================",
* Copyright © 2021 Kanri, DawnNights, Fumiama ) // 启动打印
* Project: https://github.com/FloatTech/ZeroBot-Plugin
========================================================
`) // 启动打印
zero.Run(zero.Config{ zero.Run(zero.Config{
NickName: []string{"椛椛", "ATRI", "atri", "亚托莉", "アトリ"}, NickName: []string{"椛椛", "ATRI", "atri", "亚托莉", "アトリ"},
CommandPrefix: "/", CommandPrefix: "/",
SuperUsers: os.Args[1:], // 必须修改,否则无权限
// SuperUsers 某些功能需要主人权限,可通过以下两种方式修改
// []string{}:通过代码写死的方式添加主人账号
// os.Args[1:]:通过命令行参数的方式添加主人账号
SuperUsers: append([]string{"12345678", "87654321"}, os.Args[1:]...),
Driver: []zero.Driver{ Driver: []zero.Driver{
&driver.WSClient{ &driver.WSClient{
// OneBot 正向WS 默认使用 6700 端口
Url: "ws://127.0.0.1:6700", Url: "ws://127.0.0.1:6700",
AccessToken: "", AccessToken: "",
}, },
}, },
}) })
// 帮助 // 帮助
zero.OnFullMatchGroup([]string{"help", "/help", ".help", "菜单", "帮助"}, zero.OnlyToMe).SetBlock(true).SetPriority(999). zero.OnFullMatchGroup([]string{"help", "/help", ".help", "菜单", "帮助"}, zero.OnlyToMe).SetBlock(true).SetPriority(999).
Handle(func(ctx *zero.Ctx) { Handle(func(ctx *zero.Ctx) {
ctx.SendChain(message.Text( ctx.SendChain(
"* OneBot + ZeroBot + Golang ", "\n", message.Text(strings.Join(content, "\n")),
"* Version 1.0.3 - 2021-05-02 18:50:40.5489203 +0800 CST", "\n", )
"* Copyright © 2021 Kanri, DawnNights, Fumiama ", "\n",
"* Project: https://github.com/FloatTech/ZeroBot-Plugin",
))
}) })
select {} select {}
} }