This commit is contained in:
NoLogicAlan committed 2026-05-17 00:41:44 +03:00
1 parent 117156c1b2
commit 98fe502b56
4 files changed
+26 -12

No files matched your search

+18 -10
View File
@@ -2,7 +2,7 @@ import { CommandBuilder } from "../src/CommandHandler.mjs";
import { EmbedBuilder } from "@fluxerjs/core";
import { getGlobalColor } from "../src/MessageHandler.mjs";
import { Utils } from "../src/Utils.mjs";
import { FLUXERLIST, buildVoteLink, buildProfileLink } from "../src/constants/API.mjs";
import { FLUXERLIST, buildVoteLink } from "../src/constants/API.mjs";
// Auto-remove timer for reaction navigation: 60 seconds
const EMOJI_REMOVE_TIMEOUT = 60_000;
@@ -132,20 +132,28 @@ export async function run(msg, data) {
});
}
const voteUrl = buildVoteLink(resolvedType, id);
const profileUrl = buildProfileLink(resolvedType, id);
// Use slug for website links (slugs work on the website; numeric IDs don't)
const slug = resourceId || (resolvedType === "server" ? fluxerlist?.serverSlug : fluxerlist?.botSlug);
const voteUrl = slug ? buildVoteLink(resolvedType, slug) : null;
const label = resolvedType === "server" ? "Server" : "Bot";
const descLines = [
`Support this ${label.toLowerCase()} by voting on FluxerList!`,
``,
];
if (voteUrl) {
descLines.push(`**[Vote & View Profile](${voteUrl})**`, ``);
} else {
descLines.push(`Visit [FluxerList](${FLUXERLIST.SITE_URL}) to find and vote for this ${label.toLowerCase()}.`, ``);
}
descLines.push(`Your votes help this ${label.toLowerCase()} grow and reach more users.`);
const embed = new EmbedBuilder()
.setColor(getGlobalColor())
.setTitle(`Vote on FluxerList`)
.setDescription([
`Support this ${label.toLowerCase()} by voting on FluxerList!`,
``,
`**[Vote & View Profile](${voteUrl})**`,
``,
`Your votes help this ${label.toLowerCase()} grow and reach more users.`,
].join("\n"));
.setDescription(descLines.join("\n"));
return msg.reply({ embeds: [embed] });
}
+3 -1
View File
@@ -106,7 +106,9 @@
"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.",
"apiKey": "fl_your_api_key_here",
"serverId": "remix-hq",
"botId": "remix"
"botId": "remix",
"serverSlug": "remix-hq",
"botSlug": "remix"
},
"owners": ["user id for owner-only commands", "another user id"],
"playerAFKTimeout": 60000,
+4
View File
@@ -26,11 +26,15 @@ export class FluxerListManager {
* @param {string} [config.apiKey] - FluxerList API key (prefixed with fl_)
* @param {string} [config.serverId] - Default server ID or slug for voter queries
* @param {string} [config.botId] - Default bot ID or slug for voter queries
* @param {string} [config.serverSlug] - Server URL slug for website links (e.g. "remix-hq")
* @param {string} [config.botSlug] - Bot URL slug for website links (e.g. "remix")
*/
constructor(config = {}) {
this.apiKey = config?.apiKey ?? "";
this.serverId = config?.serverId ?? "";
this.botId = config?.botId ?? "";
this.serverSlug = config?.serverSlug ?? config?.serverId ?? "";
this.botSlug = config?.botSlug ?? config?.botId ?? "";
this.enabled = !!this.apiKey;
// In-memory cache: Map<cacheKey, { data, expiresAt }>
+1 -1
View File
@@ -103,7 +103,7 @@ export class Dashboard {
if (!this.enabled || !this.redis) return;
// Use "fluxer_<botId>" as the platform so each bot's Redis messages
// are isolated. The dashboard backend must also be configured to match.
this.redis.platform = `fluxer_${botId}`;
this.redis.platform = `fluxer`;
}
// Dashboard Function Dispatch