Skip to content

Commit

Permalink
Remove imports of erlpack in favor of @yukikaze-bot/erlpack due to th…
Browse files Browse the repository at this point in the history
…e former not working on modern node
  • Loading branch information
TheArcaneBrony committed Oct 29, 2024
1 parent 8428d6d commit 25b0a22
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 21 deletions.
9 changes: 2 additions & 7 deletions src/gateway/events/Connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,9 @@ import { Config, ErlpackType } from "@spacebar/util";

let erlpack: ErlpackType | null = null;
try {
erlpack = require("erlpack") as ErlpackType;
erlpack = require("@yukikaze-bot/erlpack") as ErlpackType;
} catch (e) {
console.log("Failed to import erlpack: ", e);
try {
erlpack = require("@yukikaze-bot/erlpack") as ErlpackType;
} catch (e) {
console.log("Failed to import @yukikaze-bot/erlpack: ", e);
}
console.log("Failed to import @yukikaze-bot/erlpack: ", e);
}

// TODO: check rate limit
Expand Down
9 changes: 2 additions & 7 deletions src/gateway/events/Message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,9 @@ const bigIntJson = BigIntJson({ storeAsString: true });

let erlpack: ErlpackType | null = null;
try {
erlpack = require("erlpack") as ErlpackType;
erlpack = require("@yukikaze-bot/erlpack") as ErlpackType;
} catch (e) {
console.log("Failed to import erlpack: ", e);
try {
erlpack = require("@yukikaze-bot/erlpack") as ErlpackType;
} catch (e) {
console.log("Failed to import @yukikaze-bot/erlpack: ", e);
}
console.log("Failed to import @yukikaze-bot/erlpack: ", e);
}

export async function Message(this: WebSocket, buffer: WS.Data) {
Expand Down
9 changes: 2 additions & 7 deletions src/gateway/util/Send.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,9 @@ import path from "path";
import { ErlpackType, JSONReplacer } from "@spacebar/util";
let erlpack: ErlpackType | null = null;
try {
erlpack = require("erlpack") as ErlpackType;
erlpack = require("@yukikaze-bot/erlpack") as ErlpackType;
} catch (e) {
console.log("Failed to import erlpack: ", e);
try {
erlpack = require("@yukikaze-bot/erlpack") as ErlpackType;
} catch (e) {
console.log("Failed to import @yukikaze-bot/erlpack: ", e);
}
console.log("Failed to import @yukikaze-bot/erlpack: ", e);
}

// don't care
Expand Down

0 comments on commit 25b0a22

Please sign in to comment.