GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ProtobufBot/cpp-pbbot: C++ QQ机器人SDK

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
idl
idl
 
 
onebot_idl @ 45b9b47
onebot_idl @ 45b9b47
 
 
src
src
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
CMakeLists.txt
CMakeLists.txt
 
 
README.md
README.md
 
 

Repository files navigation

Protobuf C++ SDK

使用C++开发 ProtobufBot QQ机器人,推荐配合 GMC 使用

环境

  • drogon
  • protobuf

推荐使用 vcpkg 作为包管理工具

$ git clone https://github.com/microsoft/vcpkg
$ cd vcpkg
$ ./vcpkg/bootstrap-vcpkg.sh
$ ./vcpkg/vcpkg install protobuf
$ ./vcpkg/vcpkg install drogon

Cmake

> cmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake
> cmake --build [build directory]

开发

修改 src/event_handler/event_handler.cpp

如果有问题欢迎提issue和pr

流程介绍

  1. 启动WebSocket Server

  2. 接受binary消息,使用protobuf解析,开新线程,交给event_handler.cpp处理

  3. 发送消息保存promise在map,接收到相同echo的response后 完成promise,继续处理

支持的类型

Event(被动接受)

代码在 event_handler.cpp,建议直接基于这个修改

  • 私聊消息 handlePrivateMessageEvent
  • 群聊消息 handleGroupMessageEvent
  • 群文件上传通知 handleGroupUploadNoticeEvent
  • 管理员变动通知 handleGroupAdminNoticeEvent
  • 群成员减少通知 handleGroupDecreaseNoticeEvent
  • 群成员增加通知 handleGroupIncreaseNoticeEvent
  • 群成员被禁言通知 handleGroupBanNoticeEvent
  • 好友已添加通知 handleFriendAddNoticeEvent
  • 群消息撤回通知 handleGroupRecallNoticeEvent
  • 好友撤回通知 handleFriendRecallNoticeEvent
  • 加好友请求 handleFriendRequestEvent
  • 加群请求 handleGroupRequestEvent

API(主动执行)

代码在 Bot.cpp

  • 发送私聊消息 sendPrivateMsg
  • 发送群消息 sendGroupMsg
  • 撤回消息 deleteMsg
  • 群踢人 setGroupKick
  • 群禁言 setGroupBan
  • 全群禁言 setGroupWholeBan
  • 设置成员名片 setGroupCard
  • 退群 setGroupLeave
  • 处理加好友请求 setFriendAddRequest
  • 处理加群请求 setGroupAddRequest
  • 获取好友列表 getFriendList
  • 获取陌生人信息 getStrangerInfo
  • 获取群列表 getGroupList
  • 获取群信息 getGroupInfo
  • 获取群成员信息 getGroupMemberInfo
  • 获取群成员列表 getGroupMemberList

About

C++ QQ机器人SDK

Topics

botcoolqcppcqhttpmiraiqqbot

Resources

Readme
Activity
Custom properties

Stars

8 stars

Watchers

0 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.