mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-23 21:52:45 -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
+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