Skip to content

Latest commit

 

History

History
373 lines (320 loc) · 22.7 KB

README_zh.md

File metadata and controls

373 lines (320 loc) · 22.7 KB

Lagrange.Core Core OneBot C# C#

License Telegram

Image

English | > 简体中文 <

相关项目

Lagrange.Core NTQQ 的协议实现(👈你在这里
OpenShamrock 基于 Lsposed 实现 OneBot 标准的机器人框架
Chronocat 基于 Electron 的、模块化的 Satori 框架

文档

Lagrange.Doc

Docker 使用指南

减缓新功能的实现

Lagrange.Core 已完成了几乎所有由 Linwenxuan05 安排的功能和任务,因此大部分对库的增强将集中在下一个存储库中

功能请求将被接受,但实施时间可能较长

后续版本将添加对 NTQQ 的新功能的支持

如果可以运行 OpenShamrock , 推荐使用

免责声明

The Lagrange.Core project, including its developers, contributors, and affiliated individuals or entities, hereby explicitly disclaim any association with, support for, or endorsement of any form of illegal behavior. This disclaimer extends to any use or application of the Lagrange.Core project that may be contrary to local, national, or international laws, regulations, or ethical guidelines.

Lagrange.Core is an open-source software project designed to facilitate lawful and ethical applications in its intended use cases. It is the responsibility of each user to ensure that their usage of Lagrange.Core complies with all applicable laws and regulations in their jurisdiction.

The developers and contributors of Lagrange.Core assume no liability whatsoever for any actions taken by users that violate the law or engage in any form of illicit activity. Users are solely responsible for their own actions and any consequences that may arise from the use of Lagrange.Core.

Furthermore, any discussions, suggestions, or guidance provided by the Lagrange.Core community, including its developers, contributors, and users, should not be interpreted as legal advice. It is strongly recommended that users seek independent legal counsel to understand the legal implications of their actions and ensure compliance with the relevant laws and regulations.

By using or accessing Lagrange.Core, the user acknowledges and agrees to release the developers, contributors, and affiliated individuals or entities from any and all liability arising from the use or misuse of the project, including any legal consequences incurred as a result of their actions.

Please use Lagrange.Core responsibly and in accordance with the law.

功能列表

协议 支持情况 登录类型 支持情况 消息段 支持情况 操作 支持情况 事件 支持情况
Windows 🟢 扫码登录 🟢 图片 🟢 戳一戳 🔴 验证码 🟢
macOS 🟢 密码登录 🟢 文本 / At 🟢 撤回消息 🟢 机器人在线 🟢
Linux 🟢 快速登录 🟢 语音 🟢 退出群组 🟢 机器人离线 🟢
异常设备
密码
🔴 QQ 黄脸表情 🟢 特殊头衔 🔴 消息事件 🟢
异常设备
快速
🟢 Json 🟢 移除群成员 🟢 戳一戳事件 🔴
新设备验证 🟢 Xml 🟢 禁言群成员 🟢 消息撤回事件 🟢
合并转发 🟢 设置管理员 🟢 群成员减少 🟢
视频 🟢 处理添加好友请求 🟢 群成员增加 🟢
回复 🟢 处理加群请求 🟢 群管理员变动 🟢
文件 🟢 语音通话 🔴 群组邀请 🟢
窗口抖动(戳一戳) 🟢 Client Key 🟢 入群请求 🟢
小程序 🟢 Cookies 🟢 好友请求 🟢
发送消息 🟢 私聊输入状态 🔴
私聊语言通话 🔴

Lagrange.OneBot

二进制文件可以在 Actions 产物中找到

消息段
消息段 支持情况
纯文本 🟢
QQ 表情 🟢
图片 🟢
语音 🟢
短视频 🟢
@某人 🟢
猜拳魔法表情 🟢
掷骰子魔法表情 🟢
窗口抖动(戳一戳) 🔴
戳一戳 🟢
匿名发消息 🔴
链接分享 🔴
推荐好友 🔴
位置 🟢
音乐分享 🔴
回复 🟢
合并转发 🟢
合并转发节点 🟢
XML 消息 🔴
JSON 消息 🟢
API
API 支持情况
/send_private_msg 🟢
/send_group_msg 🟢
/send_msg 🟢
/delete_msg 🟢
/get_msg 🟢
/get_forward_msg 🟢
/send_like 🟢
/set_group_kick 🟢
/set_group_ban 🟢
/set_group_anonymous_ban 🔴
/set_group_whole_ban 🟢
/set_group_admin 🟢
/set_group_anonymous 🔴
/set_group_card 🟢
/set_group_name 🟢
/set_group_leave 🟢
/set_group_special_title 🟢
/set_friend_add_request 🟢
/set_group_add_request 🟢
/get_login_info 🟢
/get_stranger_info 🟢
/get_friend_list 🟢
/get_group_info 🟢
/get_group_list 🟢
/get_group_member_info 🟢
/get_group_member_list 🟢
~~/get_group_honor_info 🟢
/get_cookies 🟢
/get_csrf_token 🟢
/get_credentials 🟢
/get_record 🔴
/get_image 🔴
/can_send_image 🟢
/can_send_record 🟢
/get_status 🟢
/get_version_info 🟢
/set_restart 🟢
/clean_cache 🔴
事件
推送类型 事件名 支持情况
消息事件 私聊消息 🟢
消息事件 群消息 🟢
通知事件 群文件上传 🟢
通知事件 群管理员变动 🟢
通知事件 群成员减少 🟢
通知事件 群成员增加 🟢
通知事件 群禁言 🟢
通知事件 好友添加 🟢
通知事件 群消息撤回 🟢
通知事件 好友消息撤回 🟢
通知事件 群内戳一戳 🔴
通知事件 群红包运气王 🔴
通知事件 群成员荣誉变更 🔴
请求事件 加好友请求 🟢
请求事件 加群请求/邀请 🟢
元事件 生命周期 🟢
元事件 心跳事件 🟢
通信方式
通信方式 支持情况
HTTP API 🟢
HTTP POST 🟢
正向 WebSocket 🟢
反向 WebSocket 🟢

哇塞全部支持

appsettings.json 示例

如果此处密码为空,则使用扫码登录

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "SignServerUrl": "https://sign.lagrangecore.org/api/sign",
  "Account": {
    "Uin": 0,
    "Password": "",
    "Protocol": "Linux",
    "AutoReconnect": true,
    "GetOptimumServer": true
  },
  "Message": {
    "IgnoreSelf": true,
    "StringPost": false
  },
  "QrCode": {
    "ConsoleCompatibilityMode": false
  },
  "Implementations": [
    {
      "Type": "ReverseWebSocket",
      "Host": "127.0.0.1",
      "Port": 8080,
      "Suffix": "/onebot/v11/ws",
      "ReconnectInterval": 5000,
      "HeartBeatInterval": 5000,
      "HeartBeatEnable": true,
      "AccessToken": ""
    },
    {
      "Type": "ForwardWebSocket",
      "Host": "*",
      "Port": 8081,
      "HeartBeatInterval": 5000,
      "HeartBeatEnable": true,
      "AccessToken": ""
    },
    {
      "Type": "HttpPost",
      "Host": "127.0.0.1",
      "Port": 8082,
      "Suffix": "/",
      "HeartBeatInterval": 5000,
      "HeartBeatEnable": true,
      "AccessToken": ""
    },
    {
      "Type": "Http",
      "Host": "*",
      "Port": 8083,
      "AccessToken": ""
    }
  ]
}

Warning

目前,ForwardWebSocketHttp 是基于 HttpListener 实现的,它存在以下问题:

  1. 在 Linux 中,Http 请求的 Host 头必须与 Prefix 的值相匹配,除非它是 +*,因此请将 ForwardWebSocketHttpHost 配置为您用来访问它的域名或 IP。

  2. 在 Windows 中,HttpListener 基于 http.sys 实现,因此使用前需要注册 urlacl,请参阅 netsh。您也可以使用管理员启动 Lagrange.OneBot,此时 HttpListener 会自动注册所需的 urlacl

登录前须知

  • 目前新设备登录尚未实现,建议使用二维码登录
  • 目前仅有 Linux 协议的签名服务器实现, 建议使用 Linux 协议

已知问题

  • [ ] 目前尚未使用签名服务,因此容易登录失败,返回码可能为 45,您可以通过重写 Signature 静态类以使用自己的签名服务。

    感谢 KonataDev/TheSnowfield 提供的签名 API

    暂不提供签名 API,您可能需要在某个地方找到它并在 BotConfig 继承 SignProvider 类的 CustomSignProviderBotConfig

  • 内置签名服务器已经上线

  • 如需使用 Windows 和 macOS 协议,你需要自行解决签名