Discord Bot Integration
Official bot for LibreAuth Seller API — keys, hashes, users, multi-app.
Quick Install
Terminal
git clone https://github.com/Nutexe999/libreauth-Bot.git
cd libreauth-Bot
npm install
cp .env.example .env
npm startINFO
Full setup, Docker, and command list: libreauth-Bot README
Environment
TOKENDiscord bot tokenTYPEproduction or developmentSELLER_API_URLOptional — default https://libreauth.nutexe.dev/seller-api/LOG_WEBHOOK_URLOptional audit log for /getkeyWARN
Seller Key เก็บใน SQLite ผ่าน
/add-application — อย่า commit .env หรือ key ลง GitConnect LibreAuth
- Panel → Seller API → Create API Key (เปิด keys + users)
- ใน Discord รัน
/add-application sellerkey:… application:MyApp - สร้าง role ชื่อ
permsให้แอดมินที่ใช้คำสั่งได้ - ถ้ารันบน 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 command | type | LibreAuth alias |
|---|---|---|
| /seller-info, verify | info | — |
| /getkey | addkey | format=text, expiry, level |
| /keyinfo | info + key | returns hwid, status, level |
| /bankey | ban | banuser via key row |
| /unbankey | unban | — |
| /deletekey | del | delkey by key code |
| /reset-hwid | resetuser | resethwid |
| /addhash | addhash | Hash Check whitelist |
| /extend-user | extend | extenduser |
Docker
Deploy
docker compose up -d --build
docker compose logs -f libreauth-botBuild 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();INFO