feat: FluxerList integration, log channel, and stability fixes

FluxerList:
- Auto server-count sync (posts on startup, then every 30 min, budget-aware)
- Vote check wired into the vote command (60s per-user cache)
- 429/Retry-After aware rate limiting with typed actionable errors
- Enable via config.fluxerlist.apiKey (fl_ key from FluxerList dashboard)

Log channel (ErrorChannel):
- Forwards all errors/warnings + crash reports to a Fluxer channel
- Startup confirmation message + owner-only logtest command
- Fix: @fluxerjs REST needs { body: { content } } shape (empty-message bug)
This commit is contained in:
NoLogicAlan committed 2026-09-23 02:25:53 +03:00
1 parent d9b529edd7
commit 2fbbdf0322
13 files changed
+533 -93

No files matched your search

+48
View File
@@ -0,0 +1,48 @@
/**
* @module commands/logtest
* @description Owner-only diagnostic command that posts a test entry into the
* configured error-log channel (see config.errorLogChannel), so the owner can
* verify the ErrorChannel wiring end to end: tap -> queue -> REST delivery.
*/
import { CommandBuilder } from "../src/commands/index.mjs";
import { EmbedBuilder } from "@fluxerjs/core";
import { getGlobalColor } from "../src/ui/index.mjs";
import { logger } from "../src/core/Logger.mjs";
import { isLogChannelEnabled } from "../src/core/ErrorChannel.mjs";
/** @type {CommandBuilder} @description Command definition for the logtest command (owner-only). */
export const command = new CommandBuilder()
.setName("logtest")
.setDescription("Sends a test entry to your error-log channel.")
.setCategory("util")
.setRequirement(r => r.setOwnerOnly(true));
/**
* @async
* Run handler for the logtest command. Reports the ErrorChannel status and,
* when enabled, pushes one deliberately distinctive test line through
* logger.error so it travels the exact same path a real error would.
* @param {object} msg - The command message wrapper.
* @returns {Promise<void>}
*/
export async function run(msg) {
if (!isLogChannelEnabled()) {
const embed = new EmbedBuilder().setColor(getGlobalColor()).setDescription(
"❌ The error-log channel is **disabled**.\n" +
"Set `errorLogChannel.enabled` to `true` and `errorLogChannel.channelId` to your log channel ID in config.json, then restart the bot."
);
return msg.reply({ embeds: [embed] });
}
const who = msg.author?.username ?? msg.message?.author?.username ?? "owner";
logger.error(
"[LogTest]",
`Manual test entry requested by ${who} — if you can read this in the log channel, error forwarding is working.`
);
const embed = new EmbedBuilder().setColor(getGlobalColor()).setDescription(
"📨 Test entry queued — check the log channel; it should arrive within a few seconds."
);
return msg.reply({ embeds: [embed] }).catch(() => {});
}
+30 -3
View File
@@ -1,6 +1,6 @@
/** /**
* @module commands/vote * @module commands/vote
* @description View voting info, check voters, or browse voter lists for a server/bot on FluxerList. * @description View voting info, check your vote status, or browse voter lists for a server/bot on FluxerList.
*/ */
import { CommandBuilder } from "../src/commands/index.mjs"; import { CommandBuilder } from "../src/commands/index.mjs";
@@ -14,7 +14,7 @@ import { logger } from "../src/core/Logger.mjs";
/** @type {CommandBuilder} @description Command definition for the vote command. */ /** @type {CommandBuilder} @description Command definition for the vote command. */
export const command = new CommandBuilder() export const command = new CommandBuilder()
.setName("vote") .setName("vote")
.setDescription("View voting info or check voters for your server/bot on FluxerList", "commands.vote") .setDescription("View voting info or check your vote status on FluxerList", "commands.vote")
.setCategory("util") .setCategory("util")
.addAliases("voters") .addAliases("voters")
.addChoiceOption(o => .addChoiceOption(o =>
@@ -175,7 +175,34 @@ export async function run(msg, data) {
return msg.reply({ embeds: [embed] }); return msg.reply({ embeds: [embed] });
} }
case "check": case "check": {
if (!fluxerlist || !fluxerlist.enabled) return msg.reply(notConfigured(t, guildId));
const userId = msg.author?.id ?? msg.message?.author?.id;
if (!userId) {
return msg.reply({
embeds: [new EmbedBuilder()
.setColor(ERROR_COLOR)
.setDescription(this.t(msg, "responses.vote.checkUnknown"))]
});
}
const resolvedType = type || "bot";
const voted = await fluxerlist.hasVoted(userId);
const embed = new EmbedBuilder().setColor(getGlobalColor());
if (voted === null) {
embed.setDescription(this.t(msg, "responses.vote.checkUnknown"));
} else if (voted) {
embed.setDescription(this.t(msg, "responses.vote.checkYes", { type: resolvedType }));
} else {
const slug = resourceId || (resolvedType === "server" ? fluxerlist.serverSlug : fluxerlist.botSlug);
const voteUrl = slug ? buildVoteLink(resolvedType, slug) : FLUXERLIST.SITE_URL;
embed.setDescription(this.t(msg, "responses.vote.checkNo", { type: resolvedType, url: voteUrl }));
}
return msg.reply({ embeds: [embed] });
}
case "voters": { case "voters": {
if (!fluxerlist || !fluxerlist.enabled) return msg.reply(notConfigured(t, guildId)); if (!fluxerlist || !fluxerlist.enabled) return msg.reply(notConfigured(t, guildId));
+8 -4
View File
@@ -12,9 +12,11 @@
"enabled": false, "enabled": false,
"channelId": "paste the ID of the channel that should receive error logs", "channelId": "paste the ID of the channel that should receive error logs",
"forwardWarn": true, "forwardWarn": true,
"forwardInfo": false,
"startupMessage": true,
"minIntervalMs": 1500, "minIntervalMs": 1500,
"maxQueue": 40, "maxQueue": 40,
"Comment": "Forward error logs and crash reports to a Fluxer channel. Every logger.error line (and every logger.warn line when forwardWarn=true) is posted there: player failures, node disconnects, database errors, plus fatal crash reports (uncaughtException, unhandledRejection) with uptime and memory. Identical messages are deduplicated for 60s, sends are spaced by minIntervalMs, and floods beyond maxQueue pending messages are dropped with a summary line instead of spamming. channelId: enable Developer Mode in the Fluxer app, right-click the target channel and copy its ID — the bot must be able to send messages there. Fully disabled unless enabled=true AND channelId is set." "Comment": "Forward error logs and crash reports to a Fluxer channel. Every logger.error line (and every logger.warn line when forwardWarn=true) is posted there: player failures, node disconnects, database errors, plus fatal crash reports (uncaughtException, unhandledRejection) with uptime and memory. startupMessage=true sends a one-time 'Log channel connected' confirmation at boot through the real send path — if it fails, the console shows the exact permission/ID problem. forwardInfo=true ALSO forwards logger.info lines (boot activity, joins, recoveries) — useful for full visibility but much noisier; keep false for errors-only. Identical messages are deduplicated for 60s, sends are spaced by minIntervalMs, and floods beyond maxQueue pending messages are dropped with a summary line instead of spamming. Test delivery any time with the owner-only 'logtest' command. channelId: enable Developer Mode in the Fluxer app, right-click the target channel and copy its ID — the bot must be able to send messages there. Fully disabled unless enabled=true AND channelId is set."
}, },
"prefix": "your desired prefix (such as %)", "prefix": "your desired prefix (such as %)",
"presenceInterval": null, "presenceInterval": null,
@@ -110,12 +112,14 @@
"scrobbleMinMs": 240000 "scrobbleMinMs": 240000
}, },
"fluxerlist": { "fluxerlist": {
"Comment": "FluxerList integration: check voters for your server/bot. API keys are allocated by site admins, prefixed with fl_, and visible in your Dashboard. To request access, open a ticket in the Fluxer server.", "Comment": "FluxerList.com integration (docs.fluxerlist.com). Generate your own API key: FluxerList Dashboard -> Developer tab -> generate (starts with fl_, shown once). While enabled, the bot auto-posts its server count to your bot listing: once at startup, then every statsIntervalMinutes (default 30; endpoint allows 12/hour; identical counts are skipped to conserve the shared 3000 requests/month key budget). botId: your bot's Fluxer ID — leave empty to auto-detect at startup. serverId/serverSlug/botSlug: optional, used by the vote command. Set autoStats=false to disable the server-count sync only (vote command keeps working).",
"apiKey": "fl_your_api_key_here", "apiKey": "fl_your_api_key_here",
"botId": "",
"serverId": "remix-hq", "serverId": "remix-hq",
"botId": "remix",
"serverSlug": "remix-hq", "serverSlug": "remix-hq",
"botSlug": "remix" "botSlug": "remix",
"autoStats": true,
"statsIntervalMinutes": 30
}, },
"owners": [ "owners": [
"user id for owner-only commands", "user id for owner-only commands",
+2
View File
@@ -285,6 +285,8 @@ class Remix {
this.gatewayHandler.onReady(); this.gatewayHandler.onReady();
this.fluxerlist?.startAutoStats?.(client);
if (!presenceRotationStarted && presenceContents.length > 1) { if (!presenceRotationStarted && presenceContents.length > 1) {
presenceRotationStarted = true; presenceRotationStarted = true;
setInterval(() => { setInterval(() => {
+68 -15
View File
@@ -4,15 +4,21 @@
* designated Fluxer channel, so the owner sees problems (player failures, * designated Fluxer channel, so the owner sees problems (player failures,
* node disconnects, database errors, crashes) without reading container logs. * node disconnects, database errors, crashes) without reading container logs.
* *
* Two forwarding layers: * Three forwarding layers:
* 1. Logger tap: wraps logger.error and (optionally) logger.warn so every * 1. Logger tap: wraps logger.error, (optionally) logger.warn and
* existing error site in the codebase is covered without touching call * (opt-in via forwardInfo) logger.info so every existing error site in
* sites. The logger's built-in storm gate already collapses identical * the codebase is covered without touching call sites. The logger's
* repeated lines before they reach this tap. * built-in storm gate already collapses identical repeated lines before
* they reach this tap.
* 2. Crash reports: explicit reportCrash() calls from the process-level * 2. Crash reports: explicit reportCrash() calls from the process-level
* handlers in index.mjs. These bypass the queue and send immediately — * handlers in index.mjs. These bypass the queue and send immediately —
* REST keeps working even when the gateway connection is down — with a * REST keeps working even when the gateway connection is down — with a
* bounded timeout so the fatal-exit path is never stalled. * bounded timeout so the fatal-exit path is never stalled.
* 3. Startup confirmation: when enabled (startupMessage, default true), a
* one-time "Log channel connected" message is sent through the real
* send path at boot, so the owner immediately sees that forwarding works
* — and gets an explicit console hint when the channel ID or bot
* permissions are wrong instead of silent silence.
* *
* Messages are sent through client.rest.post when available, with a raw * Messages are sent through client.rest.post when available, with a raw
* fetch fallback (Authorization: Bot <token>) for very early crashes before * fetch fallback (Authorization: Bot <token>) for very early crashes before
@@ -44,12 +50,13 @@ let _maxQueue = 40;
let _queue = []; let _queue = [];
let _dropped = 0; let _dropped = 0;
let _flushing = false; let _flushing = false;
let _announced = false;
const _forwardDedup = new Map(); const _forwardDedup = new Map();
const _crashDedup = new Map(); const _crashDedup = new Map();
let _lastFailLog = 0; let _lastFailLog = 0;
const _originals = { error: null, warn: null }; const _originals = { error: null, warn: null, info: null };
/** /**
* Initialize the channel reporter from config. Safe to call once at boot; * Initialize the channel reporter from config. Safe to call once at boot;
@@ -71,8 +78,36 @@ export function initErrorChannel({ config, client } = {}) {
console.info(`[ErrorChannel] Disabled (${!_channelId ? "no channelId configured" : "enabled=false"}).`); console.info(`[ErrorChannel] Disabled (${!_channelId ? "no channelId configured" : "enabled=false"}).`);
return; return;
} }
if (!_originals.error) _tapLogger(cfg.forwardWarn !== false); const forwardWarn = cfg.forwardWarn !== false;
console.info(`[ErrorChannel] Active — forwarding errors${cfg.forwardWarn !== false ? " + warnings" : ""} to channel ${_channelId}.`); const forwardInfo = cfg.forwardInfo === true;
if (!_originals.error) _tapLogger(forwardWarn, forwardInfo);
console.info(`[ErrorChannel] Active — forwarding errors${forwardWarn ? " + warnings" : ""}${forwardInfo ? " + info" : ""} to channel ${_channelId}.`);
if (cfg.startupMessage !== false) _announceOnce();
}
/**
* Whether the channel reporter is currently active (enabled=true and a
* channelId is configured). Used by the logtest command for its status reply.
* @returns {boolean} True when forwarding is active.
*/
export function isLogChannelEnabled() {
return _enabled && Boolean(_channelId);
}
/** @private Send the one-time startup confirmation through the real send path. */
function _announceOnce() {
if (_announced) return;
_announced = true;
const content =
"✅ **Log channel connected** — from now on this channel receives:\n" +
"🔴 every error · 🟡 every warning · 🚨 crash reports (with uptime + memory)\n" +
"Verify delivery any time with the `logtest` command.";
_sendWithFallback(content).catch((e) => {
console.error(
`[ErrorChannel] Startup notice FAILED for channel ${_channelId}: ${e?.message ?? e}` +
" — check that the bot has View Channel + Send Messages permission there and that errorLogChannel.channelId is correct."
);
});
} }
/** /**
@@ -103,11 +138,10 @@ export async function reportCrash(title, err, { fatal = false } = {}) {
.slice(0, CONTENT_MAX); .slice(0, CONTENT_MAX);
try { try {
await Promise.race([_send(content), _sleep(CRASH_SEND_BUDGET_MS)]); await Promise.race([_sendWithFallback(content), _sleep(CRASH_SEND_BUDGET_MS)]);
return true; return true;
} catch (_) { } catch (_) {
await Promise.race([_sendRaw(content), _sleep(CRASH_SEND_BUDGET_MS)]); return false;
return true;
} }
} catch (_) { } catch (_) {
return false; return false;
@@ -121,8 +155,11 @@ export async function reportCrash(title, err, { fatal = false } = {}) {
export function _resetErrorChannelForTests() { export function _resetErrorChannelForTests() {
if (_originals.error) logger.error = _originals.error; if (_originals.error) logger.error = _originals.error;
if (_originals.warn) logger.warn = _originals.warn; if (_originals.warn) logger.warn = _originals.warn;
if (_originals.info) logger.info = _originals.info;
_originals.error = null; _originals.error = null;
_originals.warn = null; _originals.warn = null;
_originals.info = null;
_announced = false;
_enabled = false; _enabled = false;
_channelId = null; _channelId = null;
_token = null; _token = null;
@@ -135,7 +172,7 @@ export function _resetErrorChannelForTests() {
} }
/** @private Wrap the shared logger methods so all existing error sites forward automatically. */ /** @private Wrap the shared logger methods so all existing error sites forward automatically. */
function _tapLogger(forwardWarn) { function _tapLogger(forwardWarn, forwardInfo = false) {
_originals.error = logger.error; _originals.error = logger.error;
logger.error = function (tag, ...args) { logger.error = function (tag, ...args) {
_originals.error(tag, ...args); _originals.error(tag, ...args);
@@ -148,6 +185,13 @@ function _tapLogger(forwardWarn) {
_forward("warn", tag, args); _forward("warn", tag, args);
}; };
} }
if (forwardInfo && typeof logger.info === "function") {
_originals.info = logger.info;
logger.info = function (tag, ...args) {
_originals.info(tag, ...args);
_forward("info", tag, args);
};
}
} }
/** @private Forward one emitted log line into the queue (with dedup + self-exclusion). */ /** @private Forward one emitted log line into the queue (with dedup + self-exclusion). */
@@ -157,7 +201,7 @@ function _forward(level, tag, args) {
if (tag.startsWith("[ErrorChannel]") || tag.startsWith("[Error_Handling]")) return; if (tag.startsWith("[ErrorChannel]") || tag.startsWith("[Error_Handling]")) return;
const body = _formatArgs(args); const body = _formatArgs(args);
const now = Date.now(); const now = Date.now();
const emoji = level === "error" ? "🔴" : "🟡"; const emoji = level === "error" ? "🔴" : level === "info" ? "ℹ️" : "🟡";
const text = body ? `${emoji} **${tag}** ${body}` : `${emoji} **${tag}**`; const text = body ? `${emoji} **${tag}** ${body}` : `${emoji} **${tag}**`;
const key = `${level}|${tag}|${(body || tag).slice(0, 200)}`; const key = `${level}|${tag}|${(body || tag).slice(0, 200)}`;
const last = _forwardDedup.get(key); const last = _forwardDedup.get(key);
@@ -209,7 +253,7 @@ async function _runFlush() {
/** @private Send a queued message, swallowing and cooldown-logging failures. */ /** @private Send a queued message, swallowing and cooldown-logging failures. */
async function _sendQuietly(content) { async function _sendQuietly(content) {
try { try {
await _send(content); await _sendWithFallback(content);
} catch (e) { } catch (e) {
const now = Date.now(); const now = Date.now();
if (now - _lastFailLog > FAIL_LOG_COOLDOWN_MS) { if (now - _lastFailLog > FAIL_LOG_COOLDOWN_MS) {
@@ -223,12 +267,21 @@ async function _sendQuietly(content) {
async function _send(content) { async function _send(content) {
const rest = _client?.rest; const rest = _client?.rest;
if (typeof rest?.post === "function") { if (typeof rest?.post === "function") {
await rest.post(`/channels/${_channelId}/messages`, { content }); await rest.post(`/channels/${_channelId}/messages`, { body: { content } });
return; return;
} }
await _sendRaw(content); await _sendRaw(content);
} }
/** @private Send via client REST, retrying once via raw fetch when that throws. */
async function _sendWithFallback(content) {
try {
await _send(content);
} catch (_) {
await _sendRaw(content);
}
}
/** @private Send via a direct Fluxer REST call (Authorization: Bot <token>). */ /** @private Send via a direct Fluxer REST call (Authorization: Bot <token>). */
async function _sendRaw(content) { async function _sendRaw(content) {
const res = await fetch(`${API_BASE}/channels/${_channelId}/messages`, { const res = await fetch(`${API_BASE}/channels/${_channelId}/messages`, {
+296 -39
View File
@@ -1,4 +1,4 @@
/** @module src/services/FluxerListManager @description FluxerList API integration for fetching server/bot voter lists with caching. */ /** @module src/services/FluxerListManager @description FluxerList API integration: voter lists, server-count auto-sync for the bot listing, per-user vote checks and listing info — with per-endpoint caching, doc-accurate rate-limit handling (429 + Retry-After) and typed errors. Docs: https://docs.fluxerlist.com/api-quickstart */
import { logger } from "../core/Logger.mjs"; import { logger } from "../core/Logger.mjs";
import { import {
@@ -8,23 +8,143 @@ import {
buildFluxerListUrl, buildFluxerListUrl,
} from "../utils/API.mjs"; } from "../utils/API.mjs";
/** @class FluxerListManager @description Fetches and caches voter lists from the FluxerList API for servers and bots. */ const REQUEST_TIMEOUT_MS = 15_000;
const RATE_LIMIT_WARN_COOLDOWN_MS = 60_000;
/**
* Typed FluxerList API error. Diagnostics live in `message`; `status` carries
* the HTTP status code (0 for client-side blocks like an active rate-limit gate).
*/
export class FluxerListApiError extends Error {
/**
* @param {string} message - Human-readable diagnostic message.
* @param {number} [status=0] - HTTP status code, or 0 when blocked locally.
*/
constructor(message, status = 0) {
super(message);
this.name = "FluxerListApiError";
this.status = status;
}
}
/** @class FluxerListManager @description FluxerList API client shared by the whole bot (voter lists, stats sync, vote checks). */
export class FluxerListManager { export class FluxerListManager {
/** @param {object} [config={}] @param {string} [config.apiKey] @param {string} [config.serverId] @param {string} [config.botId] @param {string} [config.serverSlug] @param {string} [config.botSlug] */ /** @param {object} [config={}] @param {string} [config.apiKey] @param {string} [config.botId] @param {string} [config.serverId] @param {string} [config.serverSlug] @param {string} [config.botSlug] @param {boolean} [config.autoStats] @param {number} [config.statsIntervalMinutes] */
constructor(config = {}) { constructor(config = {}) {
this.apiKey = config?.apiKey ?? ""; this.apiKey = typeof config?.apiKey === "string" ? config.apiKey.trim() : "";
this.serverId = config?.serverId ?? ""; this.serverId = config?.serverId ?? "";
this.botId = config?.botId ?? ""; this.botId = config?.botId ?? "";
this.serverSlug = config?.serverSlug ?? config?.serverId ?? ""; this.serverSlug = config?.serverSlug ?? config?.serverId ?? "";
this.botSlug = config?.botSlug ?? config?.botId ?? ""; this.botSlug = config?.botSlug ?? config?.botId ?? "";
this.enabled = !!this.apiKey; this.enabled = !!this.apiKey;
this.autoStats = config?.autoStats !== false;
this.statsIntervalMinutes = Number(config?.statsIntervalMinutes) > 0
? Number(config.statsIntervalMinutes)
: 30;
this._cache = new Map(); this._cache = new Map();
this._blockedUntil = 0;
this._lastRateLimitWarn = 0;
this._lastStatsPost = 0;
this._lastPostedCount = null;
this._statsIntervalMs = FLUXERLIST_LIMITS.STATS_DEFAULT_INTERVAL_MS;
this._statsTimer = null;
this._statsClient = null;
if (!this.enabled) { if (!this.enabled) {
logger.settings("[FluxerList] Disabled — apiKey missing in config."); logger.settings("[FluxerList] Disabled — apiKey missing in config.");
} else { } else {
logger.settings("[FluxerList] Enabled — API key configured."); logger.settings(
`[FluxerList] Enabled${this.autoStats ? " — auto server-count sync every " + this.statsIntervalMinutes + " min" : ""}.`
);
}
}
/**
* @private
* Perform one authenticated API request with rate-limit gating and typed errors.
* @param {string} endpoint - Endpoint template with `:id`.
* @param {string} resourceId - Bot/server ID or slug.
* @param {{ method?: string, body?: object, query?: Record<string, string|number> }} [opts]
* @returns {Promise<object|null>} Parsed JSON response, or null for 204s.
* @throws {FluxerListApiError} On rate-limit gate or HTTP error responses.
*/
async _request(endpoint, resourceId, opts = {}) {
this._assertEnabled();
const now = Date.now();
if (now < this._blockedUntil) {
const waitS = Math.ceil((this._blockedUntil - now) / 1000);
throw new FluxerListApiError(`FluxerList rate limit is active — retrying in ${waitS}s.`, 429);
}
const method = opts.method ?? "GET";
const url = buildFluxerListUrl(endpoint, resourceId, opts.query ?? {});
const headers = {
[FLUXERLIST_AUTH.HEADER]: FLUXERLIST_AUTH.bearer(this.apiKey),
"Accept": "application/json",
"User-Agent": "RemixBot/1.0 (FluxerList Integration)",
};
if (opts.body !== undefined) headers["Content-Type"] = "application/json";
let res;
try {
res = await fetch(url, {
method,
headers,
body: opts.body !== undefined ? JSON.stringify(opts.body) : undefined,
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
});
} catch (e) {
throw new FluxerListApiError(`FluxerList request failed: ${e?.message ?? e}`, 0);
}
if (res.status === 429) {
const retryAfterS = Number(res.headers.get("retry-after")) || 0;
let resetMs = 0;
try {
const payload = await res.json();
resetMs = Number(payload?.reset) || 0;
} catch (_) { /* body not JSON — header already parsed above */ }
const waitMs = retryAfterS > 0
? retryAfterS * 1000
: Math.max(0, resetMs - Date.now()) || 60_000;
this._blockedUntil = Date.now() + waitMs;
if (Date.now() - this._lastRateLimitWarn > RATE_LIMIT_WARN_COOLDOWN_MS) {
this._lastRateLimitWarn = Date.now();
const long = waitMs > 30 * 60_000 ? " (long window — the shared 3,000/month key budget may be exhausted)" : "";
logger.warn(`[FluxerList] Rate limited — pausing all FluxerList requests for ${Math.round(waitMs / 1000)}s${long}.`);
}
throw new FluxerListApiError(
`FluxerList rate limited — retry after ${Math.round(waitMs / 1000)}s.`,
429
);
}
if (res.status === 400) {
const text = await res.text().catch(() => "");
throw new FluxerListApiError(`FluxerList rejected the request as invalid (HTTP 400): ${text.slice(0, 200)}`, 400);
}
if (res.status === 401) {
throw new FluxerListApiError("Invalid FluxerList API key. Generate one in the FluxerList Dashboard → Developer tab (keys start with fl_) and set fluxerlist.apiKey in config.json.", 401);
}
if (res.status === 403) {
throw new FluxerListApiError("FluxerList API key does not belong to this listing's owner. Use a key from the account that owns the bot/server.", 403);
}
if (res.status === 404) {
throw new FluxerListApiError(`No FluxerList listing matches "${resourceId}". Check the ID or slug in your config (e.g. "remix" from fluxerlist.com/bots/remix).`, 404);
}
if (!res.ok) {
const text = await res.text().catch(() => "");
throw new FluxerListApiError(`FluxerList API error (HTTP ${res.status}): ${text.slice(0, 200)}`, res.status);
}
if (res.status === 204) return null;
try {
return await res.json();
} catch (_) {
return null;
} }
} }
@@ -59,13 +179,13 @@ export class FluxerListManager {
} }
} }
/** @async Fetch voters from FluxerList API. @param {"server"|"bot"} type @param {string} [id] @param {object} [options={}] @param {number} [options.page] @param {number} [options.limit] @param {boolean} [options.skipCache] @returns {Promise<object>} @throws {Error} On auth, not-found, or HTTP errors. */ /** @async Fetch voters from FluxerList API. @param {"server"|"bot"} type @param {string} [id] @param {object} [options={}] @param {number} [options.page] @param {number} [options.limit] @param {boolean} [options.skipCache] @returns {Promise<object>} @throws {FluxerListApiError} On auth, not-found, or HTTP errors. */
async getVoters(type, id, options = {}) { async getVoters(type, id, options = {}) {
this._assertEnabled(); this._assertEnabled();
const resourceId = id || (type === "server" ? this.serverId : this.botId); const resourceId = id || (type === "server" ? this.serverId : this.botId);
if (!resourceId) { if (!resourceId) {
throw new Error(`No ${type} ID configured. Set it in config.json or provide it as an argument.`); throw new FluxerListApiError(`No ${type} ID configured. Set it in config.json or provide it as an argument.`, 0);
} }
const page = options.page ?? FLUXERLIST_LIMITS.DEFAULT_PAGE; const page = options.page ?? FLUXERLIST_LIMITS.DEFAULT_PAGE;
@@ -84,37 +204,10 @@ export class FluxerListManager {
? FLUXERLIST.ENDPOINTS.SERVER_VOTERS ? FLUXERLIST.ENDPOINTS.SERVER_VOTERS
: FLUXERLIST.ENDPOINTS.BOT_VOTERS; : FLUXERLIST.ENDPOINTS.BOT_VOTERS;
const url = buildFluxerListUrl(endpoint, resourceId, { page, limit }); const data = await this._request(endpoint, resourceId, { query: { page, limit } });
const res = await fetch(url, { if (typeof data?.total !== "number" || !Array.isArray(data?.voters)) {
method: "GET", throw new FluxerListApiError("Unexpected FluxerList API response format.", 0);
headers: {
[FLUXERLIST_AUTH.HEADER]: FLUXERLIST_AUTH.bearer(this.apiKey),
"Accept": "application/json",
"User-Agent": "RemixBot/1.0 (FluxerList Integration)",
},
signal: AbortSignal.timeout(15_000),
});
if (res.status === 401) {
throw new Error("Invalid FluxerList API key. Check your config.json fluxerlist.apiKey.");
}
if (res.status === 403) {
throw new Error("FluxerList API key does not belong to this resource owner.");
}
if (res.status === 404) {
const label = type === "server" ? "Server" : "Bot";
throw new Error(`${label} "${resourceId}" was not found on FluxerList. Make sure the ID or slug in your config is correct (e.g. "remix" from fluxerlist.com/bots/remix).`);
}
if (!res.ok) {
const text = await res.text().catch(() => "");
throw new Error(`FluxerList API error (HTTP ${res.status}): ${text.slice(0, 200)}`);
}
const data = await res.json();
if (typeof data.total !== "number" || !Array.isArray(data.voters)) {
throw new Error("Unexpected FluxerList API response format.");
} }
this._setCached(cacheKey, data); this._setCached(cacheKey, data);
@@ -154,10 +247,174 @@ export class FluxerListManager {
return allVoters; return allVoters;
} }
/** @private @throws {Error} If not configured. */ /**
* Post the bot's server count to its FluxerList listing.
* Docs: POST /bots/{id}/stats, limit 12 requests/hour — post on a schedule,
* not on every guild join/leave. Identical counts are skipped (unless forced)
* to conserve the shared 3,000 requests/month key budget.
* @async
* @param {number} count - Current server count (non-negative integer).
* @param {{ force?: boolean, id?: string }} [opts] - `force` bypasses the unchanged-count and min-interval guards.
* @returns {Promise<{ok: boolean, skipped?: boolean, reason?: string, serverCount?: number, retryInMs?: number}>}
* @throws {FluxerListApiError} On HTTP errors (auth, not found, rate limit).
*/
async postServerCount(count, opts = {}) {
this._assertEnabled();
const resourceId = opts.id || this.botId;
if (!resourceId) {
throw new FluxerListApiError("No bot ID available for stats sync. Set fluxerlist.botId in config.json (or let the bot auto-detect it at startup).", 0);
}
const serverCount = Number(count);
if (!Number.isInteger(serverCount) || serverCount < 0) {
throw new FluxerListApiError(`Invalid server count: ${count} (must be a non-negative integer).`, 0);
}
const now = Date.now();
if (!opts.force) {
if (serverCount === this._lastPostedCount) {
return { ok: false, skipped: true, reason: "unchanged", serverCount };
}
const sinceLast = now - this._lastStatsPost;
if (this._lastStatsPost > 0 && sinceLast < FLUXERLIST_LIMITS.STATS_MIN_INTERVAL_MS) {
return {
ok: false,
skipped: true,
reason: "too-soon",
serverCount,
retryInMs: FLUXERLIST_LIMITS.STATS_MIN_INTERVAL_MS - sinceLast,
};
}
}
const data = await this._request(FLUXERLIST.ENDPOINTS.BOT_STATS, resourceId, {
method: "POST",
body: { serverCount },
});
this._lastStatsPost = now;
this._lastPostedCount = serverCount;
logger.settings(`[FluxerList] Server count posted: ${serverCount}${typeof data?.serverCount === "number" && data.serverCount !== serverCount ? ` (listing now shows ${data.serverCount})` : ""}`);
return { ok: true, serverCount };
}
/**
* Start automatic server-count syncing: one post shortly after the bot is
* ready, then every `statsIntervalMinutes` (default 30, minimum 5 per the
* docs' 12/hour endpoint limit). The scheduled post skips identical counts
* to conserve the monthly key budget. Safe to call multiple times.
* @param {object} client - The Fluxer client (uses client.guilds.cache.size and client.user.id).
* @param {{ intervalMs?: number }} [opts] - Override the cadence (production default 30 min).
* @returns {(() => void)|null} A stop function, or null when disabled/no key.
*/
startAutoStats(client, opts = {}) {
if (!this.enabled || this.autoStats === false) return null;
if (this._statsTimer) return () => this.stopAutoStats();
const resolvedId = this.botId || client?.user?.id || "";
if (!resolvedId) {
logger.warn("[FluxerList] Auto stats sync skipped — no botId in config and client.user.id unavailable yet.");
return null;
}
if (this.botId !== resolvedId) this.botId = resolvedId;
this._statsClient = client;
const requested = opts.intervalMs ?? this.statsIntervalMinutes * 60_000;
const clamped = Math.min(
Math.max(Number(requested) || FLUXERLIST_LIMITS.STATS_DEFAULT_INTERVAL_MS, FLUXERLIST_LIMITS.STATS_MIN_INTERVAL_MS),
FLUXERLIST_LIMITS.STATS_MAX_INTERVAL_MS
);
this._statsIntervalMs = clamped;
const tick = async () => {
try {
const count = this._statsClient?.guilds?.cache?.size;
if (!Number.isFinite(count)) return;
await this.postServerCount(count, { force: !this._lastPostedCount });
} catch (e) {
logger.warn(`[FluxerList] Stats sync failed: ${e?.message ?? e}`);
}
};
logger.settings(`[FluxerList] Auto stats sync started — posting server count every ${Math.round(clamped / 60_000)} min.`);
const bootTimer = setTimeout(tick, 15_000);
bootTimer.unref?.();
this._statsTimer = setInterval(tick, clamped);
this._statsTimer.unref?.();
return () => this.stopAutoStats();
}
/** Stop the automatic server-count sync (also clears pending boot post). @returns {void} */
stopAutoStats() {
if (this._statsTimer) {
clearInterval(this._statsTimer);
this._statsTimer = null;
}
this._statsClient = null;
}
/**
* Check whether a user currently has an active vote for the bot.
* Docs: GET /bots/{id}/check?fluxerId= — 60 requests/min, so results are
* cached for 60 seconds per user.
* @async
* @param {string} userId - The Fluxer user ID to check.
* @returns {Promise<boolean|null>} `true`/`false` for the vote status, or `null` when the API failed (caller decides fail-open/fail-closed).
*/
async hasVoted(userId) {
try {
this._assertEnabled();
const resourceId = this.botId;
if (!resourceId) {
logger.warn("[FluxerList] hasVoted called without a botId (set fluxerlist.botId or wait for auto-detect).");
return null;
}
const cacheKey = `check:${resourceId}:${userId}`;
const cached = this._getCached(cacheKey);
if (cached !== null) return cached.voted;
const data = await this._request(FLUXERLIST.ENDPOINTS.BOT_CHECK, resourceId, {
query: { fluxerId: String(userId) },
});
const result = { voted: data?.voted === true, votes: Number(data?.votes) || 0 };
this._setCached(cacheKey, result, FLUXERLIST_LIMITS.VOTE_CHECK_TTL_MS);
return result.voted;
} catch (e) {
logger.warn(`[FluxerList] Vote check failed: ${e?.message ?? e}`);
return null;
}
}
/**
* Fetch the bot's own public listing data (cached for 5 minutes).
* @async
* @param {{ force?: boolean, id?: string }} [opts]
* @returns {Promise<object>} The bot listing object.
* @throws {FluxerListApiError} On HTTP errors.
*/
async getBotInfo(opts = {}) {
this._assertEnabled();
const resourceId = opts.id || this.botId;
if (!resourceId) {
throw new FluxerListApiError("No bot ID available. Set fluxerlist.botId in config.json.", 0);
}
const cacheKey = `info:${resourceId}`;
if (!opts.force) {
const cached = this._getCached(cacheKey);
if (cached) return cached;
}
const data = await this._request(FLUXERLIST.ENDPOINTS.BOT_INFO, resourceId);
this._setCached(cacheKey, data, FLUXERLIST_LIMITS.BOT_INFO_TTL_MS);
return data;
}
/** @private @throws {FluxerListApiError} If not configured. */
_assertEnabled() { _assertEnabled() {
if (!this.enabled) { if (!this.enabled) {
throw new Error("FluxerList integration is not configured (missing apiKey in config.json)."); throw new FluxerListApiError("FluxerList integration is not configured (missing apiKey in config.json). Generate one in the FluxerList Dashboard → Developer tab (keys start with fl_).", 0);
} }
} }
} }
+39 -8
View File
@@ -11,11 +11,20 @@ export const FLUXERLIST = {
/** Public FluxerList website URL. @type {string} */ /** Public FluxerList website URL. @type {string} */
SITE_URL: "https://fluxerlist.com", SITE_URL: "https://fluxerlist.com",
/** API endpoint path templates. @type {{ SERVER_VOTERS: string, BOT_VOTERS: string }} */ /** API endpoint path templates. @type {{ SERVER_VOTERS: string, BOT_VOTERS: string, BOT_STATS: string, BOT_CHECK: string, BOT_INFO: string }} */
ENDPOINTS: { ENDPOINTS: {
SERVER_VOTERS: "/servers/:id/voters", SERVER_VOTERS: "/servers/:id/voters",
BOT_VOTERS: "/bots/:id/voters", BOT_VOTERS: "/bots/:id/voters",
/** POST server count for a bot listing (body: { serverCount }). */
BOT_STATS: "/bots/:id/stats",
/** GET a user's vote status for a bot (query: fluxerId). */
BOT_CHECK: "/bots/:id/check",
/** GET a bot's public listing data. */
BOT_INFO: "/bots/:id",
}, },
/** Accepted resource type identifiers. @type {string[]} */ /** Accepted resource type identifiers. @type {string[]} */
@@ -50,7 +59,7 @@ export const FLUXERLIST_AUTH = {
}; };
/** /**
* FluxerList pagination and cache limits. * FluxerList pagination, cache and rate-limit limits (per docs.fluxerlist.com).
* @namespace FLUXERLIST_LIMITS * @namespace FLUXERLIST_LIMITS
*/ */
export const FLUXERLIST_LIMITS = { export const FLUXERLIST_LIMITS = {
@@ -63,25 +72,47 @@ export const FLUXERLIST_LIMITS = {
/** Maximum allowed items-per-page. @type {number} */ /** Maximum allowed items-per-page. @type {number} */
MAX_LIMIT: 100, MAX_LIMIT: 100,
/** Cache time-to-live in milliseconds. @type {number} */ /** Cache time-to-live in milliseconds for voter lists. @type {number} */
CACHE_TTL_MS: 5 * 60 * 1000, CACHE_TTL_MS: 5 * 60 * 1000,
/** Minimum spacing between stats posts (docs: limit is 12/hour). @type {number} */
STATS_MIN_INTERVAL_MS: 5 * 60 * 1000,
/** Recommended stats cadence (docs: "post on startup, then roughly every 30 minutes"). @type {number} */
STATS_DEFAULT_INTERVAL_MS: 30 * 60 * 1000,
/** Cache TTL for per-user vote checks (docs limit 60/min; cache on our side). @type {number} */
VOTE_CHECK_TTL_MS: 60 * 1000,
/** Cache TTL for the bot's own listing info (default 20/min bucket). @type {number} */
BOT_INFO_TTL_MS: 5 * 60 * 1000,
/** Hard cap on scheduled stats intervals accepted from config, in ms. @type {number} */
STATS_MAX_INTERVAL_MS: 6 * 60 * 60 * 1000,
}; };
/** /**
* Build a full FluxerList API URL by substituting `:id` in the endpoint and appending query params. * Build a full FluxerList API URL by substituting `:id` in the endpoint and appending query params.
* @param {string} endpoint - Endpoint template (e.g. `"/servers/:id/voters"`). * `page`/`limit` keep their clamping behavior; any other params are passed through verbatim.
* @param {string} endpoint - Endpoint template (e.g. `"/bots/:id/check"`).
* @param {string} resourceId - Value to substitute for `:id`. * @param {string} resourceId - Value to substitute for `:id`.
* @param {{ page?: number, limit?: number }} [queryParams={}] * @param {Record<string, string|number>} [queryParams={}]
* @returns {string} Fully qualified URL. * @returns {string} Fully qualified URL.
*/ */
export function buildFluxerListUrl(endpoint, resourceId, queryParams = {}) { export function buildFluxerListUrl(endpoint, resourceId, queryParams = {}) {
const path = endpoint.replace(":id", encodeURIComponent(resourceId)); const path = endpoint.replace(":id", encodeURIComponent(resourceId));
const params = new URLSearchParams(); const params = new URLSearchParams();
if (queryParams.page) params.set("page", String(queryParams.page)); for (const [key, value] of Object.entries(queryParams)) {
if (queryParams.limit) { if (value === undefined || value === null) continue;
const clamped = Math.min(Math.max(1, queryParams.limit), FLUXERLIST_LIMITS.MAX_LIMIT); if (key === "limit") {
const clamped = Math.min(Math.max(1, Number(value) || 1), FLUXERLIST_LIMITS.MAX_LIMIT);
params.set("limit", String(clamped)); params.set("limit", String(clamped));
} else if (key === "page") {
params.set("page", String(Math.max(1, Number(value) || 1)));
} else {
params.set(key, String(value));
}
} }
const qs = params.toString(); const qs = params.toString();
+7 -4
View File
@@ -759,7 +759,7 @@
"notConfigured": "❌ تكامل FluxerList غير مُعدّ على هذا البوت. اطلب من مالك البوت إضافة مفتاح FluxerList API إلى الإعدادات.", "notConfigured": "❌ تكامل FluxerList غير مُعدّ على هذا البوت. اطلب من مالك البوت إضافة مفتاح FluxerList API إلى الإعدادات.",
"noResourceId": "❌ لا يوجد معرف {{type}} مُعدّ. قدّمه عبر `{{prefix}}vote check {{type}} <id-or-slug>` أو عيّنه في config.json.", "noResourceId": "❌ لا يوجد معرف {{type}} مُعدّ. قدّمه عبر `{{prefix}}vote check {{type}} <id-or-slug>` أو عيّنه في config.json.",
"infoTitle": "تصويت FluxerList", "infoTitle": "تصويت FluxerList",
"infoDescription": "صوّت لهذا البوت/السيرفر على [FluxerList]({{siteUrl}})!\n\nFluxerList هي منصة لعرض السيرفرات والبوتات حيث يمكن للمستخدمين التصويت للمساعدة في نمو المجتمع.\n\n**الأوامر:**\n`{{prefix}}vote info` — اعرض هذه المعلومات ورابط التصويت\n`{{prefix}}vote info server` — اعرض رابط التصويت لسيرفر\n`{{prefix}}vote check` — تحقق ممن صوّت (للمالك فقط)\n`{{prefix}}vote voters` — اعرض قائمة الناخبين (للمالك فقط)", "infoDescription": "صوّت لهذا البوت/السيرفر على [FluxerList]({{siteUrl}})!\n\nFluxerList هي منصة لعرض السيرفرات والبوتات حيث يمكن للمستخدمين التصويت للمساعدة في نمو المجتمع.\n\n**الأوامر:**\n`{{prefix}}vote info` — اعرض هذه المعلومات ورابط التصويت\n`{{prefix}}vote info server` — اعرض رابط التصويت لسيرفر\n`{{prefix}}vote check` — تحقق من حالة تصويتك\n`{{prefix}}vote voters` — اعرض قائمة الناخبين (للمالك فقط)",
"voteTitle": "صوّت على FluxerList", "voteTitle": "صوّت على FluxerList",
"supportDesc": "ادعم هذا {{type}} بالتصويت على FluxerList!", "supportDesc": "ادعم هذا {{type}} بالتصويت على FluxerList!",
"voteLink": "**[صوّت واعرض الملف الشخصي]({{url}})**", "voteLink": "**[صوّت واعرض الملف الشخصي]({{url}})**",
@@ -774,12 +774,15 @@
"pageInfo": "صفحة {{page}}/{{totalPages}} من {{total}} ناخب • استخدم ◀️▶️ للتنقل", "pageInfo": "صفحة {{page}}/{{totalPages}} من {{total}} ناخب • استخدم ◀️▶️ للتنقل",
"voterTotal": "{{total}} ناخب(ناخبين) إجمالاً", "voterTotal": "{{total}} ناخب(ناخبين) إجمالاً",
"defaultCommandsTitle": "**أوامر تصويت FluxerList:**", "defaultCommandsTitle": "**أوامر تصويت FluxerList:**",
"defaultCommandsList": "`{{prefix}}vote` — اعرض معلومات التصويت والرابط\n`{{prefix}}vote info` — اعرض معلومات التصويت ورابط التصويت\n`{{prefix}}vote check` — تحقق ممن صوّت (للمالك فقط)\n`{{prefix}}vote voters` — اعرض قائمة الناخبين (للمالك فقط)", "defaultCommandsList": "`{{prefix}}vote` — اعرض معلومات التصويت والرابط\n`{{prefix}}vote info` — اعرض معلومات التصويت ورابط التصويت\n`{{prefix}}vote check` — تحقق من حالة تصويتك\n`{{prefix}}vote voters` — اعرض قائمة الناخبين (للمالك فقط)",
"optionsTitle": "**الخيارات:**", "optionsTitle": "**الخيارات:**",
"optionsList": "`{{prefix}}vote check server` — تحقق من الناخبين لسيرفر\n`{{prefix}}vote check bot` — تحقق من الناخبين لبوت", "optionsList": "`{{prefix}}vote check server` — تحقق من حالة تصويتك لسيرفر\n`{{prefix}}vote check bot` — تحقق من حالة تصويتك لبوت",
"votedDate": "صوّت {{date}}", "votedDate": "صوّت {{date}}",
"unknownUser": "مستخدم#{{id}}", "unknownUser": "مستخدم#{{id}}",
"unknownDate": "غير معروف" "unknownDate": "غير معروف",
"checkYes": "✅ لديك **تصويت نشط** لهذا {{type}} — شكرًا لك!",
"checkNo": "❌ لم تصوّت لهذا {{type}} بعد (أو انتهت صلاحية تصويتك).\n**[صوّت الآن!]({{url}})**",
"checkUnknown": "⚠️ تعذّر التحقق من حالة تصويتك الآن — حاول مجددًا بعد دقيقة."
}, },
"seek": { "seek": {
"nothingPlaying": "❌ لا يوجد شيء يعمل حالياً!", "nothingPlaying": "❌ لا يوجد شيء يعمل حالياً!",
+7 -4
View File
@@ -759,7 +759,7 @@
"notConfigured": "❌ تەواوکاری FluxerList لەسەر ئەم بوتە ڕێکنەخراوە. لە خاوەنی بوتەکە بخۆشتن کلیلی FluxerList API زیاد بکات.", "notConfigured": "❌ تەواوکاری FluxerList لەسەر ئەم بوتە ڕێکنەخراوە. لە خاوەنی بوتەکە بخۆشتن کلیلی FluxerList API زیاد بکات.",
"noResourceId": "❌ هیچ {{type}} ID ڕێکنەخراوە. بە `{{prefix}}vote check {{type}} <id-or-slug>` دایبنێ یان لە config.json دایبنێ.", "noResourceId": "❌ هیچ {{type}} ID ڕێکنەخراوە. بە `{{prefix}}vote check {{type}} <id-or-slug>` دایبنێ یان لە config.json دایبنێ.",
"infoTitle": "دەنگدانی FluxerList", "infoTitle": "دەنگدانی FluxerList",
"infoDescription": "بۆ ئەم بوت/سێرڤەرە دەنگبدە لە [FluxerList]({{siteUrl}})!\n\nFluxerList پلاتفۆرمێکی لیستی سێرڤەر و بوتە کە بەکارهێنەران دەتوانن دەنگبدەن بۆ یارمەتیدانی گەشتی کۆمەڵگە.\n\n**فەرمانەکان:**\n`{{prefix}}vote info` — ئەم زانیارییە و لینکی دەنگدان نیشانبدە\n`{{prefix}}vote info server` — لینکی دەنگدان بۆ سێرڤەر نیشانبدە\n`{{prefix}}vote check` — پشکنی کێ دەنگیدا (تەنها بۆ خاوەن)\n`{{prefix}}vote voters` — لیستی دەنگدەران نیشانبدە (تەنها بۆ خاوەن)", "infoDescription": "بۆ ئەم بوت/سێرڤەرە دەنگبدە لە [FluxerList]({{siteUrl}})!\n\nFluxerList پلاتفۆرمێکی لیستی سێرڤەر و بوتە کە بەکارهێنەران دەتوانن دەنگبدەن بۆ یارمەتیدانی گەشتی کۆمەڵگە.\n\n**فەرمانەکان:**\n`{{prefix}}vote info` — ئەم زانیارییە و لینکی دەنگدان نیشانبدە\n`{{prefix}}vote info server` — لینکی دەنگدان بۆ سێرڤەر نیشانبدە\n`{{prefix}}vote check` — دۆخی دەنگدانی خۆت بپشکنە\n`{{prefix}}vote voters` — لیستی دەنگدەران نیشانبدە (تەنها بۆ خاوەن)",
"voteTitle": "لە FluxerList دەنگبدە", "voteTitle": "لە FluxerList دەنگبدە",
"supportDesc": "ئەم {{type}} پشتگیری بکە بە دەنگدان لە FluxerList!", "supportDesc": "ئەم {{type}} پشتگیری بکە بە دەنگدان لە FluxerList!",
"voteLink": "**[دەنگبدە و پرۆفایل ببینە]({{url}})**", "voteLink": "**[دەنگبدە و پرۆفایل ببینە]({{url}})**",
@@ -774,12 +774,15 @@
"pageInfo": "لاپەڕە {{page}}/{{totalPages}} لە {{total}} دەنگدەر • بۆ ناوەڕۆک ◀️▶️ بەکاربهێنە", "pageInfo": "لاپەڕە {{page}}/{{totalPages}} لە {{total}} دەنگدەر • بۆ ناوەڕۆک ◀️▶️ بەکاربهێنە",
"voterTotal": "{{total}} دەنگدەر(ەکان) بە گشتی", "voterTotal": "{{total}} دەنگدەر(ەکان) بە گشتی",
"defaultCommandsTitle": "**فەرمانەکانی دەنگدانی FluxerList:**", "defaultCommandsTitle": "**فەرمانەکانی دەنگدانی FluxerList:**",
"defaultCommandsList": "`{{prefix}}vote` — زانیاری دەنگدان و لینک نیشانبدە\n`{{prefix}}vote info` — زانیاری دەنگدان و لینک نیشانبدە\n`{{prefix}}vote check` — پشکنی کێ دەنگیدا (تەنها بۆ خاوەن)\n`{{prefix}}vote voters` — لیستی دەنگدەران نیشانبدە (تەنها بۆ خاوەن)", "defaultCommandsList": "`{{prefix}}vote` — زانیاری دەنگدان و لینک نیشانبدە\n`{{prefix}}vote info` — زانیاری دەنگدان و لینک نیشانبدە\n`{{prefix}}vote check` — دۆخی دەنگدانی خۆت بپشکنە\n`{{prefix}}vote voters` — لیستی دەنگدەران نیشانبدە (تەنها بۆ خاوەن)",
"optionsTitle": "**هەڵبژاردنەکان:**", "optionsTitle": "**هەڵبژاردنەکان:**",
"optionsList": "`{{prefix}}vote check server` — دەنگدەرانی سێرڤەر بپشکنە\n`{{prefix}}vote check bot` — دەنگدەرانی بوت بپشکنە", "optionsList": "`{{prefix}}vote check server` — دۆخی دەنگدانی خۆت بۆ سێرڤەر بپشکنە\n`{{prefix}}vote check bot` — دۆخی دەنگدانی خۆت بۆ بوت بپشکنە",
"votedDate": "دەنگیدا {{date}}", "votedDate": "دەنگیدا {{date}}",
"unknownUser": "بەکارهێنەر#{{id}}", "unknownUser": "بەکارهێنەر#{{id}}",
"unknownDate": "نەناسراو" "unknownDate": "نەناسراو",
"checkYes": "✅ دەنگدانی **چالاکیت هەیە** بۆ ئەم {{type}} — سوپاس!",
"checkNo": "❌ هێشتا دەنگت بۆ ئەم {{type}} نەداوە (یان دەنگت کۆتایی هاتووە).\n**[ئێستا دەنگبدە!]({{url}})**",
"checkUnknown": "⚠️ ئێستا نەتوانرا دۆخی دەنگدانت بپشکنرێت — دوای خولەکێک دووبارە هەوڵبدە."
}, },
"seek": { "seek": {
"nothingPlaying": "❌ هیچ شتێک پەخش ناکرێت لە ئێستادا!", "nothingPlaying": "❌ هیچ شتێک پەخش ناکرێت لە ئێستادا!",
+7 -4
View File
@@ -759,7 +759,7 @@
"notConfigured": "❌ FluxerList-Integration ist auf diesem Bot nicht konfiguriert. Bitte den Bot-Besitzer, einen FluxerList API-Schlüssel zur Konfiguration hinzuzufügen.", "notConfigured": "❌ FluxerList-Integration ist auf diesem Bot nicht konfiguriert. Bitte den Bot-Besitzer, einen FluxerList API-Schlüssel zur Konfiguration hinzuzufügen.",
"noResourceId": "❌ Keine {{type}}-ID konfiguriert. Gib sie mit `{{prefix}}vote check {{type}} <id-or-slug>` an oder setze sie in config.json.", "noResourceId": "❌ Keine {{type}}-ID konfiguriert. Gib sie mit `{{prefix}}vote check {{type}} <id-or-slug>` an oder setze sie in config.json.",
"infoTitle": "FluxerList-Abstimmung", "infoTitle": "FluxerList-Abstimmung",
"infoDescription": "Stimme für diesen Bot/Server auf [FluxerList]({{siteUrl}})!\n\nFluxerList ist eine Server- und Bot-Auflistungsplattform, auf der Nutzer abstimmen können, um das Community-Wachstum zu fördern.\n\n**Befehle:**\n`{{prefix}}vote info` — Zeige diese Info & Abstimmungslink\n`{{prefix}}vote info server` — Zeige Abstimmungslink für einen Server\n`{{prefix}}vote check` — Prüfe, wer abgestimmt hat (nur Besitzer)\n`{{prefix}}vote voters` — Zeige die Wählerliste (nur Besitzer)", "infoDescription": "Stimme für diesen Bot/Server auf [FluxerList]({{siteUrl}})!\n\nFluxerList ist eine Server- und Bot-Auflistungsplattform, auf der Nutzer abstimmen können, um das Community-Wachstum zu fördern.\n\n**Befehle:**\n`{{prefix}}vote info` — Zeige diese Info & Abstimmungslink\n`{{prefix}}vote info server` — Zeige Abstimmungslink für einen Server\n`{{prefix}}vote check` — Prüfe dein eigenes Votum\n`{{prefix}}vote voters` — Zeige die Wählerliste (nur Besitzer)",
"voteTitle": "Auf FluxerList abstimmen", "voteTitle": "Auf FluxerList abstimmen",
"supportDesc": "Unterstütze dieses {{type}} durch Abstimmung auf FluxerList!", "supportDesc": "Unterstütze dieses {{type}} durch Abstimmung auf FluxerList!",
"voteLink": "**[Abstimmen & Profil ansehen]({{url}})**", "voteLink": "**[Abstimmen & Profil ansehen]({{url}})**",
@@ -774,12 +774,15 @@
"pageInfo": "Seite {{page}}/{{totalPages}} von {{total}} Wählern • Nutze ◀️▶️ zum Navigieren", "pageInfo": "Seite {{page}}/{{totalPages}} von {{total}} Wählern • Nutze ◀️▶️ zum Navigieren",
"voterTotal": "{{total}} Wähler insgesamt", "voterTotal": "{{total}} Wähler insgesamt",
"defaultCommandsTitle": "**FluxerList-Abstimmungsbefehle:**", "defaultCommandsTitle": "**FluxerList-Abstimmungsbefehle:**",
"defaultCommandsList": "`{{prefix}}vote` — Zeige Abstimmungsinfo & Link\n`{{prefix}}vote info` — Zeige Abstimmungsinfo & Link\n`{{prefix}}vote check` — Prüfe, wer abgestimmt hat (nur Besitzer)\n`{{prefix}}vote voters` — Zeige Wählerliste (nur Besitzer)", "defaultCommandsList": "`{{prefix}}vote` — Zeige Abstimmungsinfo & Link\n`{{prefix}}vote info` — Zeige Abstimmungsinfo & Link\n`{{prefix}}vote check` — Prüfe dein eigenes Votum\n`{{prefix}}vote voters` — Zeige Wählerliste (nur Besitzer)",
"optionsTitle": "**Optionen:**", "optionsTitle": "**Optionen:**",
"optionsList": "`{{prefix}}vote check server` — Prüfe Wähler für einen Server\n`{{prefix}}vote check bot` — Prüfe Wähler für einen Bot", "optionsList": "`{{prefix}}vote check server` — Prüfe dein Votum für einen Server\n`{{prefix}}vote check bot` — Prüfe dein Votum für einen Bot",
"votedDate": "abgestimmt {{date}}", "votedDate": "abgestimmt {{date}}",
"unknownUser": "Benutzer#{{id}}", "unknownUser": "Benutzer#{{id}}",
"unknownDate": "Unbekannt" "unknownDate": "Unbekannt",
"checkYes": "✅ Du hast ein **aktives Votum** für diesen {{type}} — danke!",
"checkNo": "❌ Du hast für diesen {{type}} noch nicht abgestimmt (oder dein Votum ist abgelaufen).\n**[Jetzt voten!]({{url}})**",
"checkUnknown": "⚠️ Dein Votum konnte gerade nicht geprüft werden — versuche es in einer Minute erneut."
}, },
"seek": { "seek": {
"nothingPlaying": "❌ Es wird gerade nichts abgespielt!", "nothingPlaying": "❌ Es wird gerade nichts abgespielt!",
+7 -4
View File
@@ -749,7 +749,7 @@
"notConfigured": "❌ FluxerList integration is not configured on this bot. Ask the bot owner to add a FluxerList API key to the config.", "notConfigured": "❌ FluxerList integration is not configured on this bot. Ask the bot owner to add a FluxerList API key to the config.",
"noResourceId": "❌ No {{type}} ID configured. Provide it with `{{prefix}}vote check {{type}} <id-or-slug>` or set it in config.json.", "noResourceId": "❌ No {{type}} ID configured. Provide it with `{{prefix}}vote check {{type}} <id-or-slug>` or set it in config.json.",
"infoTitle": "FluxerList Vote", "infoTitle": "FluxerList Vote",
"infoDescription": "Vote for this bot/server on [FluxerList]({{siteUrl}})!\n\nFluxerList is a server and bot listing platform where users can vote to help grow the community.\n\n**Commands:**\n`{{prefix}}vote info` — Show this info & vote link\n`{{prefix}}vote info server` — Show vote link for a server\n`{{prefix}}vote check` — Check who voted (owner-only)\n`{{prefix}}vote voters` — View the voter list (owner-only)", "infoDescription": "Vote for this bot/server on [FluxerList]({{siteUrl}})!\n\nFluxerList is a server and bot listing platform where users can vote to help grow the community.\n\n**Commands:**\n`{{prefix}}vote info` — Show this info & vote link\n`{{prefix}}vote info server` — Show vote link for a server\n`{{prefix}}vote check` — Check your own vote status\n`{{prefix}}vote voters` — View the voter list (owner-only)",
"voteTitle": "Vote on FluxerList", "voteTitle": "Vote on FluxerList",
"supportDesc": "Support this {{type}} by voting on FluxerList!", "supportDesc": "Support this {{type}} by voting on FluxerList!",
"voteLink": "**[Vote & View Profile]({{url}})**", "voteLink": "**[Vote & View Profile]({{url}})**",
@@ -764,12 +764,15 @@
"pageInfo": "Page {{page}}/{{totalPages}} of {{total}} voters • Use ◀️▶️ to navigate", "pageInfo": "Page {{page}}/{{totalPages}} of {{total}} voters • Use ◀️▶️ to navigate",
"voterTotal": "{{total}} voter(s) total", "voterTotal": "{{total}} voter(s) total",
"defaultCommandsTitle": "**FluxerList Vote Commands:**", "defaultCommandsTitle": "**FluxerList Vote Commands:**",
"defaultCommandsList": "`{{prefix}}vote` — Show vote info & link\n`{{prefix}}vote info` — Show voting info & vote link\n`{{prefix}}vote check` — Check who voted (owner-only)\n`{{prefix}}vote voters` — View the voter list (owner-only)", "defaultCommandsList": "`{{prefix}}vote` — Show vote info & link\n`{{prefix}}vote info` — Show voting info & vote link\n`{{prefix}}vote check` — Check your own vote status\n`{{prefix}}vote voters` — View the voter list (owner-only)",
"optionsTitle": "**Options:**", "optionsTitle": "**Options:**",
"optionsList": "`{{prefix}}vote check server` — Check voters for a server\n`{{prefix}}vote check bot` — Check voters for a bot", "optionsList": "`{{prefix}}vote check server` — Check your vote status for a server\n`{{prefix}}vote check bot` — Check your vote status for a bot",
"votedDate": "voted {{date}}", "votedDate": "voted {{date}}",
"unknownUser": "User#{{id}}", "unknownUser": "User#{{id}}",
"unknownDate": "Unknown" "unknownDate": "Unknown",
"checkYes": "✅ You **have an active vote** for this {{type}} — thank you!",
"checkNo": "❌ You haven't voted for this {{type}} yet (or your vote expired).\n**[Vote now!]({{url}})**",
"checkUnknown": "⚠️ Couldn't check your vote status right now — try again in a minute."
}, },
"volumedefault": { "volumedefault": {
"title": "🔊 Volume Settings", "title": "🔊 Volume Settings",
+7 -4
View File
@@ -759,7 +759,7 @@
"notConfigured": "❌ Integração com FluxerList não está configurada neste bot. Peça ao dono do bot para adicionar uma chave de API do FluxerList na configuração.", "notConfigured": "❌ Integração com FluxerList não está configurada neste bot. Peça ao dono do bot para adicionar uma chave de API do FluxerList na configuração.",
"noResourceId": "❌ Nenhum ID de {{type}} configurado. Forneça com `{{prefix}}vote check {{type}} <id-or-slug>` ou defina em config.json.", "noResourceId": "❌ Nenhum ID de {{type}} configurado. Forneça com `{{prefix}}vote check {{type}} <id-or-slug>` ou defina em config.json.",
"infoTitle": "Votação FluxerList", "infoTitle": "Votação FluxerList",
"infoDescription": "Vote para este bot/servidor no [FluxerList]({{siteUrl}})!\n\nFluxerList é uma plataforma de listagem de servidores e bots onde os usuários podem votar para ajudar a crescer a comunidade.\n\n**Comandos:**\n`{{prefix}}vote info` — Mostra esta informação e link de votação\n`{{prefix}}vote info server` — Mostra link de votação para um servidor\n`{{prefix}}vote check` — Verifique quem votou (somente dono)\n`{{prefix}}vote voters` — Veja a lista de eleitores (somente dono)", "infoDescription": "Vote para este bot/servidor no [FluxerList]({{siteUrl}})!\n\nFluxerList é uma plataforma de listagem de servidores e bots onde os usuários podem votar para ajudar a crescer a comunidade.\n\n**Comandos:**\n`{{prefix}}vote info` — Mostra esta informação e link de votação\n`{{prefix}}vote info server` — Mostra link de votação para um servidor\n`{{prefix}}vote check` — Verifique seu próprio voto\n`{{prefix}}vote voters` — Veja a lista de eleitores (somente dono)",
"voteTitle": "Vote no FluxerList", "voteTitle": "Vote no FluxerList",
"supportDesc": "Apoie este {{type}} votando no FluxerList!", "supportDesc": "Apoie este {{type}} votando no FluxerList!",
"voteLink": "**[Vote e Veja o Perfil]({{url}})**", "voteLink": "**[Vote e Veja o Perfil]({{url}})**",
@@ -774,12 +774,15 @@
"pageInfo": "Página {{page}}/{{totalPages}} de {{total}} eleitores • Use ◀️▶️ para navegar", "pageInfo": "Página {{page}}/{{totalPages}} de {{total}} eleitores • Use ◀️▶️ para navegar",
"voterTotal": "{{total}} eleitor(es) no total", "voterTotal": "{{total}} eleitor(es) no total",
"defaultCommandsTitle": "**Comandos de Votação FluxerList:**", "defaultCommandsTitle": "**Comandos de Votação FluxerList:**",
"defaultCommandsList": "`{{prefix}}vote` — Mostra info de votação e link\n`{{prefix}}vote info` — Mostra info de votação e link\n`{{prefix}}vote check` — Verifique quem votou (somente dono)\n`{{prefix}}vote voters` — Veja a lista de eleitores (somente dono)", "defaultCommandsList": "`{{prefix}}vote` — Mostra info de votação e link\n`{{prefix}}vote info` — Mostra info de votação e link\n`{{prefix}}vote check` — Verifique seu próprio voto\n`{{prefix}}vote voters` — Veja a lista de eleitores (somente dono)",
"optionsTitle": "**Opções:**", "optionsTitle": "**Opções:**",
"optionsList": "`{{prefix}}vote check server` — Verifique eleitores de um servidor\n`{{prefix}}vote check bot` — Verifique eleitores de um bot", "optionsList": "`{{prefix}}vote check server` — Verifique seu voto em um servidor\n`{{prefix}}vote check bot` — Verifique seu voto em um bot",
"votedDate": "votou {{date}}", "votedDate": "votou {{date}}",
"unknownUser": "Usuário#{{id}}", "unknownUser": "Usuário#{{id}}",
"unknownDate": "Desconhecido" "unknownDate": "Desconhecido",
"checkYes": "✅ Você **tem um voto ativo** para este {{type}} — obrigado!",
"checkNo": "❌ Você ainda não votou neste {{type}} (ou seu voto expirou).\n**[Vote agora!]({{url}})**",
"checkUnknown": "⚠️ Não foi possível verificar seu voto agora — tente novamente em um minuto."
}, },
"seek": { "seek": {
"nothingPlaying": "❌ Não está tocando nada no momento!", "nothingPlaying": "❌ Não está tocando nada no momento!",
+7 -4
View File
@@ -801,7 +801,7 @@
"notConfigured": "❌ FluxerList entegrasyonu bu botta yapılandırılmamış. Bot sahibinden FluxerList API anahtarı eklemesini isteyin.", "notConfigured": "❌ FluxerList entegrasyonu bu botta yapılandırılmamış. Bot sahibinden FluxerList API anahtarı eklemesini isteyin.",
"noResourceId": "❌ {{type}} ID yapılandırılmamış. `{{prefix}}vote check {{type}} <id-or-slug>` ile sağlayın veya config.json'da ayarlayın.", "noResourceId": "❌ {{type}} ID yapılandırılmamış. `{{prefix}}vote check {{type}} <id-or-slug>` ile sağlayın veya config.json'da ayarlayın.",
"infoTitle": "FluxerList Oylama", "infoTitle": "FluxerList Oylama",
"infoDescription": "Bu bot/sunucu için [FluxerList]({{siteUrl}}) üzerinde oy verin!\n\nFluxerList, kullanıcıların topluluğun büyümesine yardımcı olmak için oy verebileceği bir sunucu ve bot listeleme platformudur.\n\n**Komutlar:**\n`{{prefix}}vote info` — Bu bilgiyi ve oylama bağlantısını göster\n`{{prefix}}vote info server` — Bir sunucu için oylama bağlantısını göster\n`{{prefix}}vote check` — Kimin oy verdiğini kontrol et (sadece sahip)\n`{{prefix}}vote voters` — Oy verenler listesini görüntüle (sadece sahip)", "infoDescription": "Bu bot/sunucu için [FluxerList]({{siteUrl}}) üzerinde oy verin!\n\nFluxerList, kullanıcıların topluluğun büyümesine yardımcı olmak için oy verebileceği bir sunucu ve bot listeleme platformudur.\n\n**Komutlar:**\n`{{prefix}}vote info` — Bu bilgiyi ve oylama bağlantısını göster\n`{{prefix}}vote info server` — Bir sunucu için oylama bağlantısını göster\n`{{prefix}}vote check` — Kendi oy durumunu kontrol et\n`{{prefix}}vote voters` — Oy verenler listesini görüntüle (sadece sahip)",
"voteTitle": "FluxerList'te Oy Ver", "voteTitle": "FluxerList'te Oy Ver",
"supportDesc": "Bu {{type}} için FluxerList'te oy vererek destekleyin!", "supportDesc": "Bu {{type}} için FluxerList'te oy vererek destekleyin!",
"voteLink": "**[Oy Ver ve Profili Görüntüle]({{url}})**", "voteLink": "**[Oy Ver ve Profili Görüntüle]({{url}})**",
@@ -816,12 +816,15 @@
"pageInfo": "Sayfa {{page}}/{{totalPages}} / {{total}} oy veren • Gezinmek için ◀️▶️ kullanın", "pageInfo": "Sayfa {{page}}/{{totalPages}} / {{total}} oy veren • Gezinmek için ◀️▶️ kullanın",
"voterTotal": "Toplam {{total}} oy veren", "voterTotal": "Toplam {{total}} oy veren",
"defaultCommandsTitle": "**FluxerList Oylama Komutları:**", "defaultCommandsTitle": "**FluxerList Oylama Komutları:**",
"defaultCommandsList": "`{{prefix}}vote` — Oylama bilgisini ve bağlantıyı göster\n`{{prefix}}vote info` — Oylama bilgisini ve bağlantıyı göster\n`{{prefix}}vote check` — Kimin oy verdiğini kontrol et (sadece sahip)\n`{{prefix}}vote voters` — Oy verenler listesini görüntüle (sadece sahip)", "defaultCommandsList": "`{{prefix}}vote` — Oylama bilgisini ve bağlantıyı göster\n`{{prefix}}vote info` — Oylama bilgisini ve bağlantıyı göster\n`{{prefix}}vote check` — Kendi oy durumunu kontrol et\n`{{prefix}}vote voters` — Oy verenler listesini görüntüle (sadece sahip)",
"optionsTitle": "**Seçenekler:**", "optionsTitle": "**Seçenekler:**",
"optionsList": "`{{prefix}}vote check server` — Bir sunucu için oy verenleri kontrol et\n`{{prefix}}vote check bot` — Bir bot için oy verenleri kontrol et", "optionsList": "`{{prefix}}vote check server` — Bir sunucu için oy durumunu kontrol et\n`{{prefix}}vote check bot` — Bir bot için oy durumunu kontrol et",
"votedDate": "{{date}} tarihinde oy verdi", "votedDate": "{{date}} tarihinde oy verdi",
"unknownUser": "Kullanıcı#{{id}}", "unknownUser": "Kullanıcı#{{id}}",
"unknownDate": "Bilinmiyor" "unknownDate": "Bilinmiyor",
"checkYes": "✅ Bu {{type}} için **aktif oyunun var** — teşekkürler!",
"checkNo": "❌ Bu {{type}} için henüz oy vermedin (ya da oyunun süresi doldu).\n**[Hemen oy ver!]({{url}})**",
"checkUnknown": "⚠️ Oy durumu şu anda kontrol edilemedi — bir dakika sonra tekrar dene."
} }
} }
} }