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 🙏

© 2026 – Pkg Stats / Ryan Hefner

koishi-plugin-lottery-game

v1.0.4

Published

完整的彩票系统,包括用户注册、权限管理、签到、答题、兑换码、商店购买和抽奖等功能

Readme

Koishi Lottery Plugin

一个基于 Koishi 的抽奖插件,支持多种功能,包括用户管理、抽奖、答题、商店等。

功能概述

  1. 用户管理

    • 注册昵称
    • 每日签到
    • 查看积分和个人信息
  2. 抽奖系统

    • 购买彩票
    • 开奖逻辑(时间或数量触发)
    • 查看开奖状态和历史获奖名单
  3. 答题系统

    • 随机答题获取积分
    • 每日答题次数限制
    • 查看答题统计
  4. 商店系统

    • 购买不同类型的彩票
    • 查看商店商品
  5. 授权与兑换

    • 生成和使用授权码
    • 生成和使用兑换码

安装与配置

  1. 安装插件:

    npm install koishi-plugin-lottery
  2. 在 Koishi 配置文件中启用插件并配置参数:

    import { AppConfig } from 'koishi'
       
    export default {
      plugins: {
        lottery: {
          superAdminIds: ['超级管理员ID'],
          signText: '天天开心',
          signMinPoints: 10,
          signMaxPoints: 50,
          lotteryMethod: 'time',
          lotteryTime: 300,
          lotteryQuantity: 10,
          questions: [
            {
              question: '问题内容',
              options: ['选项1', '选项2', '选项3'],
              answer: 0,
              points: 10,
              dailyLimit: 3
            }
          ],
          shopItems: [
            { name: '低级彩票', price: 100, stock: 1000, type: 'low' },
            { name: '中级彩票', price: 500, stock: 500, type: 'medium' },
            { name: '高级彩票', price: 1000, stock: 100, type: 'high' }
          ]
        }
      }
    } as AppConfig

使用说明

用户管理

  • 注册昵称注册昵称 昵称名
  • 每日签到签到 签到文本
  • 查看积分我的积分
  • 查看个人信息我的信息

抽奖系统

  • 购买彩票购买彩票 彩票类型 [数量]
  • 查看开奖状态开奖状态
  • 查看获奖名单获奖名单

答题系统

  • 答题答题
  • 查看答题统计答题统计

商店系统

  • 查看商店彩票商店

授权与兑换

  • 生成授权码生成授权码 天数
  • 使用授权码使用授权码 授权码
  • 生成兑换码生成兑换码 积分
  • 使用兑换码使用兑换码 兑换码

注意事项

  • 确保数据库表已正确初始化。
  • 配置中的 superAdminIds 必须包含超级管理员的用户ID。
  • 每日签到和答题次数限制基于用户本地时间。

贡献

欢迎提交 Issue 或 Pull Request 改进插件功能。