Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ if (!process.env.CLUSTERS || !process.env.CLUSTER_ID) {

// Initialize the cluster client.
cluster = new DadbotClusterClient(
{ name: "ws", options: { url: "ws://localhost:8080/manager" } },
{ name: "ws", options: { url: `ws://${process.env.MANAGER_HOST || 'localhost'}:${process.env.MANAGER_PORT || '8080'}/manager` } },
process.env.CLUSTER_MANAGER_TOKEN,
JSON.parse(await readFile("./data/schema.json", "utf-8")),
{
Expand Down Expand Up @@ -424,7 +424,7 @@ if (!process.env.CLUSTERS || !process.env.CLUSTER_ID) {

// Finally, tell the client to connect to Discord.
client.connect();
})();
})().catch(console.error);

function deathCroak(thing: string | number) {
client.disconnect(false);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ShardAllocator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export async function getShardAllocation(
json = (await response.json()) as any;

if (response.status === 429) throw new Error("Ratelimited");
if (response.status !== 200) throw new Error("Unexpected response");
if (response.status !== 200) throw new Error("Unexpected response: " + response.statusText + "\n" + response.body);

body.total = json.shards;
body.totalSessions = json.session_start_limit.total;
Expand Down