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

onebot-client

v1.1.1

Published

onebot client SDK

Downloads

69

Readme

onebot-client

oneBot 客户端SDK

Install

1 使用包管理器

npm i onebot-client

2 使用cdn链接


<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/index.umd.js"></script>

Usage

1. linkServer

const {Client} = require('onebot-client')
const client=new Client(147258369,{
    remote_url:'ws://localhost:6700',// 你onebot启动时设置的websocket连接地址
    access_token:'',//鉴权token
})
clent.start.then(()=>{
    // do sth
})

2. listen event

client.on('message.private',(event)=>{
    event.reply('hello') // listen all private message, reply hello
})
client.pickFriend(22998833).on('message',(event)=>{
    event.reply('hi') // listen friend(22998833) reply hi
})
client.pickGroup(42342342).pickMember(532422).on('message',(event)=>{
    event.recall() // listen group(42342342) member(532422) message, recall that
})

3. send message

client.sendPrivateMsg(22998833,'hello') // send hello to friend 22998833
client.sendGroupMsg(42342342,'hi') // send hi to group 42342342

4. getClient info

client.getGroupList() // 
client.pickGroup(42342342).info // get groupInfo
client.getFriendList() //
client.pickFriend(22998833).info // get friendInfo
client.getGroupMemberList(42342342) // get groupMemberList
client.pickGroup(42342342).pickMember(22998833).info  // get memberInfo

fix request/notice

client.on('notice',(notice)=>{
    // fix all notice
})
client.on('request',(notice)=>{
    // fix all request
})
client.pickGroup(42342342).on('notice') // fix group(42342342) notice
client.pickGroup(42342342).on('request') // fix group(42342342) request
client.pickGroup(42342342).on('notice.increase') // fix group(42342342) increase notice
client.pickGroup(42342342).on('request.add') // fix group(42342342) add request

more

TypeDocs