Skip to content

ExquisiteCore/LagrangeGo-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LagrangeGo-Template

A template for LagrangeGo

Go Report Card

基于 LagrangeGo 的Bot 模板参考自MiraiGo-Template

基础配置

账号配置application.toml

[bot]
# 账号 必填
account = 114514
# 密码 选填
password = "pwd"

不配置密码的话将使用扫码登录

快速入门

克隆本项目

logic/custom_logic.go注册逻辑

// RegisterCustomLogic 注册所有自定义逻辑
func RegisterCustomLogic() {
 // 注册私聊消息处理逻辑
 Manager.RegisterPrivateMessageHandler(func(client *client.QQClient, event *message.PrivateMessage) {
  client.SendPrivateMessage(event.Sender.Uin, []message.IMessageElement{message.NewText("Hello World!")})
 })

 // 注册群消息处理逻辑
 Manager.RegisterGroupMessageHandler(func(client *client.QQClient, event *message.GroupMessage) {
  client.SendGroupMessage(event.GroupUin, []message.IMessageElement{message.NewText("Hello World!")})
 })
}

引入的第三方 go module

  • LagrangeGo 核心协议库
  • toml 用于解析配置文件,同时可监听配toml置文件的修改
  • logrus 功能丰富的Logger

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages