WARNING
此仓库与腾讯公司没有从属关系,仅作个人学习开发和使用。
- QQBotNet.Core QQ机器人的非官方C# SDK
- QQBotNet.OneBot QQ机器人基于Net6.0的OneBot实现
QQ机器人的非官方C# SDK
dotnet add package QQBotNet.Core
using QQBotNet.Core;
using QQBotNet.Core.Services.Apis;
// 初始化实例
var botInstance = new BotInstance(114514, "1919810");
// 启动WebSocket服务
botInstance.WebSocketService.Start();
// 消息处理
botInstance.EventDispatcher.MessageCreated += async (_, e) =>
await botInstance.HttpService.SendMessageAsync(e.Data!.ChannelId, "hello");
Task.Delay(20000).Wait();
// 释放相关资源
botInstance.Dispose();
- 所有
public
类和成员均有XML注释 - 所有OpenApi使用扩展方法声明且支持异步调用
- 实体类和API全覆盖
- 优化了tx的**的API返回格式
- 支持多Net框架
- .NET
- .NET Core
- .NET Standard
- .NET Framework
- Mono
- Xamarin
QQBotNet.Core
BotInstance
机器人实例类Constants
常量
QQBotNet.Core.Models.Business
业务相关实体类QQBotNet.Core.Models.Business.Announcement
QQBotNet.Core.Models.Business.Audio
QQBotNet.Core.Models.Business.Channels
QQBotNet.Core.Models.Business.Forums
QQBotNet.Core.Models.Business.Guilds
QQBotNet.Core.Models.Business.Members
QQBotNet.Core.Models.Business.Messages
QQBotNet.Core.Models.Business.Messages.Keyboard
QQBotNet.Core.Models.Business.Permissions
QQBotNet.Core.Models.Business.Reactions
QQBotNet.Core.Models.Business.Schedules
QQBotNet.Core.Models.Packets
业务相关实体类QQBotNet.Core.Models.Packets.OpenApi
QQBotNet.Core.Models.Packets.WebSocket
QQBotNet.Core.Services
Http服务和WebSocket服务QQBotNet.Core.Services.Apis
Http服务的Api扩展类QQBotNet.Core.Services.Events
事件分发
QQBotNet.Core.Services.Utils.Extensions
工具扩展类
- HttpApi
- WebSocket
- 鉴权连接
- 维持心跳
- 二级事件分发
- 分片连接
QQ机器人基于Net6.0的OneBot实现(🚧暂未完工)
C:\>QQBotNet.OneBot.exe -h
Description:
QQBot的OneBot实现
Usage:
QQBotNet.OneBot [command] [options]
Options:
--version Show version information
-?, -h, --help Show help and usage information
Commands:
cfg 创建"config.json"
run <botAppId> <botToken> <appSecret> 使用命令行参数运行
- 传参
-
config.json
- 命令行参数
run
-
- 通信
- Http
- Http-Post
- 正向WebSocket
- 反向WebSocket
- 事件
- 收到消息
- API
- 发送消息