mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
ugh
This commit is contained in:
1 parent
f7ed8843e7
commit
117156c1b2
4 files changed
+14
-14
No files matched your search
@@ -24,8 +24,8 @@ export class FluxerListManager {
|
||||
/**
|
||||
* @param {object} config - The `fluxerlist` section from config.json
|
||||
* @param {string} [config.apiKey] - FluxerList API key (prefixed with fl_)
|
||||
* @param {string} [config.serverId] - Default server slug for voter queries
|
||||
* @param {string} [config.botId] - Default bot slug for voter queries
|
||||
* @param {string} [config.serverId] - Default server ID or slug for voter queries
|
||||
* @param {string} [config.botId] - Default bot ID or slug for voter queries
|
||||
*/
|
||||
constructor(config = {}) {
|
||||
this.apiKey = config?.apiKey ?? "";
|
||||
@@ -99,7 +99,7 @@ export class FluxerListManager {
|
||||
* Fetch the list of voters for a server or bot.
|
||||
*
|
||||
* @param {"server"|"bot"} type - Resource type
|
||||
* @param {string} [id] - Server or bot slug (falls back to config default)
|
||||
* @param {string} [id] - Server or bot ID or slug (falls back to config default)
|
||||
* @param {object} [options]
|
||||
* @param {number} [options.page=1] - Page number (1-based)
|
||||
* @param {number} [options.limit=50] - Results per page (max 100)
|
||||
@@ -154,7 +154,7 @@ export class FluxerListManager {
|
||||
}
|
||||
if (res.status === 404) {
|
||||
const label = type === "server" ? "Server" : "Bot";
|
||||
throw new Error(`${label} "${resourceId}" was not found on FluxerList. Make sure the slug in your config is correct — it should match the URL slug (e.g. "remix" from fluxerlist.com/bots/remix).`);
|
||||
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(() => "");
|
||||
@@ -177,7 +177,7 @@ export class FluxerListManager {
|
||||
|
||||
/**
|
||||
* Convenience: fetch voters for a server.
|
||||
* @param {string} [id] - Server slug (falls back to config default)
|
||||
* @param {string} [id] - Server ID or slug (falls back to config default)
|
||||
* @param {object} [options] - Same as getVoters options
|
||||
* @returns {Promise<object>}
|
||||
*/
|
||||
@@ -187,7 +187,7 @@ export class FluxerListManager {
|
||||
|
||||
/**
|
||||
* Convenience: fetch voters for a bot.
|
||||
* @param {string} [id] - Bot slug (falls back to config default)
|
||||
* @param {string} [id] - Bot ID or slug (falls back to config default)
|
||||
* @param {object} [options] - Same as getVoters options
|
||||
* @returns {Promise<object>}
|
||||
*/
|
||||
@@ -200,7 +200,7 @@ export class FluxerListManager {
|
||||
* Use with caution on resources with many voters — this makes multiple API calls.
|
||||
*
|
||||
* @param {"server"|"bot"} type
|
||||
* @param {string} [id] - Resource slug
|
||||
* @param {string} [id] - Resource ID or slug
|
||||
* @param {object} [options]
|
||||
* @param {number} [options.limit=100] - Results per page (uses max to minimize calls)
|
||||
* @returns {Promise<Array<{ username: string, fluxerId: number, votedAt: string }>>}
|
||||
|
||||
Reference in new issue
Block a user