Skip to content

JavaScript安卓QQ协议库 / 机器人

License

Notifications You must be signed in to change notification settings

liumengxiang/oicq

 
 

Repository files navigation

oicq

npm version node engine discord

  • QQ(安卓)协议基于Node.js的实现,同时参考了 mirai 等优秀开源项目
  • 使用CQHTTP风格的API,原生支持经典CQ码,代替死去的酷Q
  • 已实现大部分常用功能,支持最低node版本为 v12.16
  • awesome 社区相关应用收集。

Install:

> npm init    # or > yarn init
> npm i oicq  # or > yarn add oicq

Usage:

const { createClient } = require("oicq");
const uin = 123456789; // your account
const client = createClient(uin);

//监听上线事件
client.on("system.online", () => console.log("Logged in!"));

//监听消息并回复
client.on("message", (data) => data.reply("hello world"));

//监听滑动验证码事件并输入ticket
client.on("system.login.slider", function () {
  process.stdin.once("data", (input) => {
    this.sliderLogin(input);
  });
});

client.login("password"); // your password or password_md5

常用功能一瞥:

client.sendGroupMsg(gid, "hello") //群聊
client.sendPrivateMsg(uid, "hello") //私聊
client.deleteMsg(id) //撤回
client.setGroupKick(gid, uid) //踢人
client.setGroupBan(gid, uid, 3600) //禁言

更详细的例子:demo.js
更多API:index.d.ts

相关文档:

滑动验证码ticket教程
API参考文档
事件参考文档
常见问题
关于封号和风控
wiki列表

其他:

JavaScript语言基础
Node.js入门教程
5分钟上手TypeScript
group:236172566

About

JavaScript安卓QQ协议库 / 机器人

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%