Skip to content

Commit

Permalink
refactor: remove shutdown logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Zamiell committed Nov 28, 2023
1 parent 033d626 commit 38b1f40
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 19 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"isaacscript": "^3.23.0",
"isaacscript-common-node": "^1.2.0",
"isaacscript-common-ts": "^11.4.0",
"shutdown-async": "^1.2.3",
"tmi.js": "^1.8.5",
"winston": "^3.11.0",
"zod": "^3.22.4"
Expand Down
7 changes: 0 additions & 7 deletions src/discord.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Message } from "discord.js";
import { ChannelType } from "discord.js";
import { addExitHandler } from "shutdown-async";
import { client } from "./client.js";
import { INFO_COMMAND_MAP } from "./config/infoCommands.js";
import { COMMAND_PREFIX_DISCORD } from "./constants.js";
Expand All @@ -13,8 +12,6 @@ export async function discordInit(): Promise<void> {
client.on("ready", onReady);
client.on("messageCreate", onMessageCreate);

addExitHandler(discordShutdown);

logger.info("Logging in to Discord...");
await client.login(env.DISCORD_TOKEN);
}
Expand Down Expand Up @@ -87,7 +84,3 @@ function logDiscordTextMessage(message: Message) {
`[${channelName}] <${message.author.username}#${message.author.discriminator}> ${message.content}`,
);
}

async function discordShutdown(): Promise<void> {
await client.destroy();
}
3 changes: 0 additions & 3 deletions src/types/shutdown-async.d.ts

This file was deleted.

8 changes: 0 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6630,13 +6630,6 @@ __metadata:
languageName: node
linkType: hard

"shutdown-async@npm:^1.2.3":
version: 1.2.3
resolution: "shutdown-async@npm:1.2.3"
checksum: b167f5391f1df1d3263ffe31ee1a903c4c7959915680f65e0ebac364bd2ec0a38c398c8c9179a8eb4987ddfec31035261c3a0cece9b9982d71757e7a60d46065
languageName: node
linkType: hard

"signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7":
version: 3.0.7
resolution: "signal-exit@npm:3.0.7"
Expand Down Expand Up @@ -7726,7 +7719,6 @@ __metadata:
isaacscript-common-ts: "npm:^11.4.0"
isaacscript-lint: "npm:^6.4.1"
isaacscript-tsconfig: "npm:^5.0.0"
shutdown-async: "npm:^1.2.3"
tmi.js: "npm:^1.8.5"
tsx: "npm:^4.5.0"
typescript: "npm:^5.3.2"
Expand Down

0 comments on commit 38b1f40

Please sign in to comment.