LibreAuth

Discord Bot Integration

Official bot for LibreAuth Seller API — keys, hashes, users, multi-app.

libreauth-Bot

Production-ready discord.js v14 bot — slash commands, multi-app SQLite config, Docker, audit webhook. Clone and run in minutes.

Quick Install

Terminal
git clone https://github.com/Nutexe999/libreauth-Bot.git
cd libreauth-Bot
npm install
cp .env.example .env
npm start
INFO
Full setup, Docker, and command list: libreauth-Bot README

Environment

TOKENDiscord bot token
TYPEproduction or development
SELLER_API_URLOptional — default https://libreauth.nutexe.dev/seller-api/
LOG_WEBHOOK_URLOptional audit log for /getkey
WARN
Seller Key เก็บใน SQLite ผ่าน /add-application — อย่า commit .env หรือ key ลง Git

Connect LibreAuth

  1. Panel → Seller API → Create API Key (เปิด keys + users)
  2. ใน Discord รัน /add-application sellerkey:… application:MyApp
  3. สร้าง role ชื่อ perms ให้แอดมินที่ใช้คำสั่งได้
  4. ถ้ารันบน VPS — ใส่ IP ใน Seller Key whitelist

ถ้า account มีแอปเดียว Seller API จะ auto-select app — ถ้ามีหลายแอป ส่ง app หรือ name ใน request

Slash Commands

Settings

/add-application · /delete-application · /seller-info

Licenses

/getkey · /keyinfo · /bankey · /unbankey · /deletekey · /reset-hwid

Security

/addhash — MD5 whitelist หลัง build

Users

/extend-user — ต่ออายุ subscription

Key Mask (สำคัญ)

WARN
ตัว * ใน mask = ตำแหน่งที่ระบบสุ่มตัวอักษร — ไม่ใส่ * = คีย์ตายตัวตาม mask นั้นเลย
ส่ง maskผลลัพธ์
Test11-******prefix + สุ่ม เช่น Test11-g3eyX4
Test11 (ไม่มี *)คีย์ตายตัว Test11 — ไม่สุ่มต่อท้าย
1d หรือ 1dayระบบเติม -******-****** อัตโนมัติ (กัน prefix สั้นเกินไป)
1day-******ใช้ตามที่พิมพ์ — ไม่แก้ให้
******-******-******สุ่มทั้งคีย์ (default)

บอท custom (เช่น genkey_new) ควรส่ง mask ตามตารางด้านบน · อยากได้ Test11-xxxx ต้องพิมพ์ Test11-****** เอง ไม่ใช่แค่ Test11

Custom bot — copy ไป bot.js
function shouldAutoExpandMask(mask) {
  const m = String(mask || "").trim();
  if (!m || m.includes("*")) return false;
  if (m.length < 5) return true;
  return /^\d+(d|day|days|w|week|weeks|m|month|months|y|year|years)?$/i.test(m);
}
function normalizeMask(mask) {
  let m = String(mask || "").trim();
  if (!m) return "******-******-******";
  if (shouldAutoExpandMask(m)) m = m.replace(/-+$/, "") + "-******-******";
  return m;
}
// addkey params: { mask: normalizeMask(userMask), expiry, amount: 1, note: "..." }

ถ้า addkey ได้ HTTP 500 — ดู Seller API Errors และเปิดสิทธิ์ addkey ใน Panel

Bot → Seller API

Bot commandtypeLibreAuth alias
/seller-info, verifyinfo
/getkeyaddkeyformat=text, expiry, level
/keyinfoinfo + keyreturns hwid, status, level
/bankeybanbanuser via key row
/unbankeyunban
/deletekeydeldelkey by key code
/reset-hwidresetuserresethwid
/addhashaddhashHash Check whitelist
/extend-userextendextenduser

Docker

Deploy
docker compose up -d --build
docker compose logs -f libreauth-bot

Build Your Own

Minimal fetch helper — same GET style as the bot uses:

fetch example
const qs = new URLSearchParams({
  sellerkey: process.env.SELLER_KEY,
  type: 'addhash',
  hash: 'd41d8cd98f00b204e9800998ecf8427e',
});
const res = await fetch('https://libreauth.nutexe.dev/seller-api/?' + qs);
const body = await res.json();