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

haikz-discord-bot

v1.0.0

Published

Discord bot untuk commerce, ticket, server cloning, dan automation. Stack: Node.js + discord.js + better-sqlite3 + Express webhook.

Readme

HaikzBot — Discord Commerce Platform

Discord bot untuk commerce, ticket, server cloning, dan automation. Stack: Node.js + discord.js + better-sqlite3 + Express webhook.

Features

Setup Wizard/setup auto-create kategori store / ticket / welcome / logs ✅ Server Clone/clone snapshot di server lama, /clone apply di server baru. Copy roles, channels, categories, permissions. Tidak menyalin member/pesan/history. ✅ Store + QRIS/product add, /stock add, /store panel. Auto-delivery via DM saat bayar. ✅ Ticket System — panel + auto-create channel, claim, transcript HTML dengan auto-redact (email/phone/token/QRIS). ✅ Welcome + Logs — auto-greet member baru, account-age check, audit log. ✅ Emoji/emoji add upload via URL/attachment. ✅ Automation — order expiry, daily report, low-stock alert ke owner. ✅ Web webhook — Tripay QRIS, mock provider buat dev.

Setup

cd /root/main/discord-bot
cp .env.example .env
# Edit .env — minimal isi: DISCORD_TOKEN, CLIENT_ID, OWNER_ID, DEV_GUILD_ID
npm install
npm run deploy   # register slash commands
npm start

.env wajib

DISCORD_TOKEN=          # dari Discord Developer Portal → Bot
CLIENT_ID=              # Application ID
OWNER_ID=               # Discord user ID kamu
DEV_GUILD_ID=           # Server testing (instant register)

.env optional

PAYMENT_PROVIDER=mock   # tripay | mock
TRIPAY_API_KEY=
TRIPAY_PRIVATE_KEY=
TRIPAY_MERCHANT_CODE=
WEB_BASE_URL=https://your-domain.com  # for callback URLs

Cara dapet token Discord

  1. Buka https://discord.com/developers/applications
  2. New Application → Bot → Reset Token → copy ke DISCORD_TOKEN
  3. OAuth2 → URL Generator → centang bot + applications.commands
  4. Bot Permissions: Administrator (atau permission spesifik: Manage Channels, Manage Roles, Manage Webhooks, Manage Emojis, Send Messages, Embed Links, Attach Files, Read Message History, Manage Messages, Create Public Threads)
  5. Invite link → buka di browser → pilih server kamu
  6. Application ID di General Information → copy ke CLIENT_ID

Discord Intents (PENTING)

Di Bot page, enable:

  • Server Members Intent (buat welcome / member event)
  • Message Content Intent (buat ticket auto-respond AI)
  • Presence Intent (optional)

Test flow

  1. /setup → klik Full Setup — auto-create kategori store/ticket/welcome/logs
  2. /product add name:"VPN Premium" price:50000 — buat produk
  3. /stock add product_id:1 content:"user1:pass1 | user2:pass2" — isi stok
  4. /store panel channel:#products — kirim panel beli
  5. Klik produk dari menu → invoice generated → klik tombol Bayar
  6. Mock provider auto-success → DM otomatis dengan stok

Server clone

  1. Di server lama: /clone snapshot — bot bikin snapshot (return ID misalnya 5)
  2. Invite bot ke server baru
  3. Di server baru: /clone apply snapshot_id:5 → pilih Full clone
  4. Bot create roles + categories + channels + permissions

Architecture

src/
├── index.js                 # entry point
├── core/
│   ├── db.js               # better-sqlite3 schema + helpers
│   └── loader.js           # auto-load commands & events
├── commands/               # slash commands
│   ├── setup.js
│   ├── clone.js
│   ├── ticket.js
│   ├── store.js
│   ├── product.js
│   ├── stock.js
│   ├── emoji.js
│   ├── config.js
│   └── help.js
├── events/
│   ├── ready.js
│   ├── interactionCreate.js
│   └── guildMemberAdd.js
├── modules/
│   ├── server-clone/       # snapshot + apply
│   ├── setup-wizard/       # full setup auto-create
│   ├── ticket/             # buttons + transcript
│   ├── store/              # checkout flow
│   ├── payment/            # provider abstraction + delivery
│   └── automation/         # cron scheduler
└── web/
    └── server.js           # Express webhook receiver

Database

SQLite di data/bot.db. Schema lengkap di src/core/db.js. Tables:

  • guilds — config per server
  • products + stock — katalog
  • orders — transaksi
  • tickets — sistem ticket
  • clone_snapshots — server clone snapshots
  • audit_log — semua action

Production checklist

  • [ ] Pasang Tripay credentials di .env
  • [ ] Set WEB_BASE_URL ke domain public (untuk callback)
  • [ ] Reverse proxy (nginx) ke port WEB_PORT (default 4002) dengan TLS
  • [ ] Whitelist Tripay IP di firewall
  • [ ] PM2 / systemd untuk auto-restart
  • [ ] Backup data/bot.db daily
  • [ ] Monitor /api/stats endpoint