Skip to content
/ oicq Public
forked from takayama-lily/oicq

Node.js实现的安卓协议QQ机器人

License

Notifications You must be signed in to change notification settings

Sc-Softs/oicq

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

463 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OICQ

npm version node engine Gitter

  • QQ(安卓)协议的nodejs实现。也参考了一些其他开源仓库如mirai、miraiGo等。
  • 以高效和稳定为第一目的,在此基础上不断完善,将会逐步支持手机协议的大部分功能。
  • 使用 CQHTTP 风格的API、事件和参数,并且原生支持经典的CQ码。
  • 请使用 Nodejs 12.16 以上版本。有bug请告诉我。
  • 内核已完全稳定,希望更多热爱JS/TS的玩家一同来完善社区和生态。

API简洁友好,开箱即用,推荐直接引入依赖进行开发。

Install:

# npm i oicq

Example:

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

//监听并输入验证码
bot.on("system.login.captcha", ()=>{
  process.stdin.once("data", input=>{
    bot.captchaLogin(input);
  });
});

bot.on("message", data=>{
  console.log(data);
  if (data.group_id > 0)
    bot.sendGroupMsg(data.group_id, "hello");
  else
    bot.sendPrivateMsg(data.user_id, "hello");
});

const password = "password";  // your password or password_md5
bot.login(password);

更详细的例子可以参考 demo.js

跨进程通信可直接使用:

http-api

使用内置的控制台进行调试:

# npm i
# npm test

相关文档:

功能实现程度
API
事件
消息ID规则
登陆失败常见问题

About

Node.js实现的安卓协议QQ机器人

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%