mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
feat: add optional instanceUrl support for self-hosted Fluxer instances
This commit is contained in:
1 parent
e9a58f422a
commit
87accdacba
2 files changed
+14
-2
No files matched your search
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"Comment": "Fluxer music bot configuration. Requires Node.js >= 22.13.0. Run 'node --version' to verify.",
|
||||
"token": "your bot token",
|
||||
"instanceUrl": null,
|
||||
"instanceUrl-Comment": "Optional base URL of a self-hosted Fluxer instance (e.g. 'https://chat.example.com'). Leave null or omit to connect to the official fluxer.app.",
|
||||
"fluxer.js": {
|
||||
"rest": {
|
||||
"Comment": "REST client options. 'timeout' is ms before a request to api.fluxer.app is aborted (default: 15000). Raise if you see DOMException AbortError in logs.",
|
||||
|
||||
+12
-2
@@ -156,7 +156,7 @@ class Remix {
|
||||
intentionalLeaveTTL: timers.intentionalLeaveTTL ?? 10_000,
|
||||
};
|
||||
|
||||
const client = new Client({
|
||||
const clientOptions = {
|
||||
waitForGuilds: true,
|
||||
cache: {
|
||||
guilds: 10_000,
|
||||
@@ -167,7 +167,17 @@ class Remix {
|
||||
},
|
||||
...config["fluxer.js"],
|
||||
presence: presenceContents.length === 0 ? undefined : buildRuntimePresence(presenceContents[0]),
|
||||
});
|
||||
};
|
||||
|
||||
if (config.instanceUrl) {
|
||||
const url = String(config.instanceUrl).trim().replace(/\/+$/, "");
|
||||
if (url) {
|
||||
clientOptions.instance = { api: url };
|
||||
logger.info(`[Startup] Self-hosted instance configured: ${url}`);
|
||||
}
|
||||
}
|
||||
|
||||
const client = new Client(clientOptions);
|
||||
|
||||
client.setMaxListeners(50);
|
||||
this.client = client;
|
||||
|
||||
Reference in new issue
Block a user