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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@yuzaijs/extension-onebot11types

v0.1.0

Published

Onebotv11 types extension for Yuzai bot framework

Readme

雨仔 OneBot 11 类型定义扩展

OneBot 11 类型定义扩展为雨仔机器人框架提供完整的 OneBot 11 和 go-cqhttp 协议的 TypeScript 类型定义。该扩展包含了所有标准事件、消息和 API 响应的类型定义,帮助开发者在编写适配器和插件时获得完整的类型检查和智能提示。

功能特性

  • 完整的 OneBot 11 标准类型定义
  • 扩展的 go-cqhttp 类型支持
  • 详细的 TypeScript 接口和类型注释
  • 包含所有消息段类型的定义
  • 支持所有事件类型的类型定义

支持的类型

消息段类型

  • 文本消息段 (text)
  • 表情消息段 (face)
  • 图片消息段 (image)
  • 语音消息段 (record)
  • 视频消息段 (video)
  • At 消息段 (at)
  • 回复消息段 (reply)
  • JSON 消息段 (json)
  • XML 消息段 (xml)
  • 链接分享消息段 (share)
  • 音乐分享消息段 (music)
  • 戳一戳消息段 (poke)
  • 等数十种消息段类型

事件类型

  • 消息事件 (私聊消息、群消息)
  • 通知事件 (群文件上传、群管理员变动、群成员增减等)
  • 请求事件 (好友请求、群请求/邀请)
  • 元事件 (生命周期、心跳事件)

使用方法

在代码中导入需要的类型:

import type {
  Onebot11MessageEvent,
  Onebot11PrivateMessageEvent,
  Onebot11GroupMessageEvent,
  Onebot11TextMessageSegment,
  Onebot11ImageMessageSegment,
} from "@yuzaijs/extension-onebot11types";

// 在适配器中使用类型定义处理消息
function handleMessage(event: Onebot11MessageEvent) {
  if (event.message_type === "private") {
    // 处理私聊消息
    const privateEvent = event as Onebot11PrivateMessageEvent;
    console.log(`收到私聊消息来自用户 ${privateEvent.user_id}`);
  }
}