Giter Site home page Giter Site logo

oicq's Introduction

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

oicq's People

Contributors

14kay avatar clansty avatar cloud370 avatar steve-xmh avatar takayama-lily avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.