npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@vikiboss/oicq

v1.21.6

Published

QQ protocol

Downloads

15

Readme

oicq

QQ 协议基于 node 的实现,确保 node 版本 ≥ 12.16

协议支持:iPadAWatchAPadAPhoneMacOS

安装

npm

npm i oicq

yarn

yarn add oicq

使用

扫码登录

使用手机 QQ 扫描二维码登录,不需要通过滑块和设备锁验证,但 token 失效时需要重新扫码。

const oicq = require('oicq');

// 配置账号并创建实例
const qq = 123456789;
const client = oicq.createClient(account);

// 监听上线事件
client.on('system.online', () => console.log('账号登录成功,已正常上线。'));

// 监听消息并回复
client.on('message', (event) => event.reply('Hello'));

// 扫码后按回车登录
const qr_login = (event) => process.stdin.once('data', this.login);

// 这里不填写密码
client.on('system.login.qrcode', qr_login);

// 完成验证后登录
client.login();

密码登录

使用明文或者 md5 加密过的密码登录,一劳永逸,但是可能首次登录需要通过滑块验证,有几率会环境异常。

const oicq = require('oicq');

// 配置账号并创建实例
const qq = 123456789;
const client = oicq.createClient(account);

// 监听上线事件
client.on('system.online', () => console.log('账号登录成功,已正常上线。'));

// 监听消息并回复
client.on('message', (event) => event.reply('Hello'));

// 滑块事件监听函数,用于输入 ticket 来通过滑块验证
const pwd_login = (event) => process.stdin.once('data', this.sliderLogin);
// 设备锁监听函数,当验证完成后,按回车确认
const dev_login = (event) => process.stdin.once('data', this.login);

// 监听登录保护对应的验证事件
client.on('system.login.slider', pwd_login);
client.on('system.login.device', dev_login);

// 完成验证后,需要填写明文密码或 md5 加密后的密码进行登录
client.login('password');

常用功能

client.sendGroupMsg(group_id, 'hello'); // 向指定群发送群聊消息
client.sendPrivateMsg(user_id, 'hello'); // 向指定好友发送私聊消息
client.deleteMsg(message_id); // 撤回指定消息 id 的消息
client.setGroupKick(group_id, uid); // 将指定群成员移出指定群
client.setGroupBan(group_id, user_id, 3600); // 禁言指定群指定人指定时间,单位是秒

感谢

此为修改版本,原项目地址:takayama-lily/oicq - master