Skip to content

Commit 8dd8d61

Browse files
committed
fix: broken functions + #119
yeah my solution is terrible but i love it
1 parent b3783bc commit 8dd8d61

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/commands.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
twitchAddNewChannelToTrack,
2323
twitchAddNewGuildToTrackChannel,
2424
twitchCheckIfChannelIsAlreadyTracked,
25-
twitchCheckIfGuildIsTrackingChannelAlready,
2625
twitchStopGuildTrackingChannel,
2726
} from "./utils/database";
2827
import getChannelDetails from "./utils/youtube/getChannelDetails";
@@ -133,7 +132,8 @@ const commands: Record<string, Command> = {
133132
data: {
134133
options: [],
135134
name: "usage",
136-
description: "Check the heap size and disk usage of the bot!",
135+
description:
136+
"Check the heap size and disk usage of the bot! (Stats for nerds)",
137137
integration_types: [0, 1],
138138
contexts: [0, 1, 2],
139139
},
@@ -318,7 +318,7 @@ const commands: Record<string, Command> = {
318318
}
319319

320320
switch (targetPlatform) {
321-
case "youtube":
321+
case "youtube": {
322322
// Check that the channel ID is in a valid format
323323
if (
324324
platformUserId.length != 24 ||
@@ -400,6 +400,7 @@ const commands: Record<string, Command> = {
400400
}
401401

402402
return;
403+
}
403404
case "twitch": {
404405
// Check if the streamer exists by getting the ID
405406
const streamerId = await getStreamerId(platformUserId);
@@ -626,7 +627,7 @@ const commands: Record<string, Command> = {
626627

627628
// check if the channel is not being tracked in the guild
628629
if (
629-
!(await twitchCheckIfGuildIsTrackingChannelAlready(
630+
!(await checkIfGuildIsTrackingChannelAlready(
630631
streamerId,
631632
guildId,
632633
))

src/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import fs from "fs/promises";
33
import path from "path";
44

5+
import Bun from "bun";
56
import {
67
Client,
78
GatewayIntentBits,
@@ -79,3 +80,11 @@ await Promise.all(
7980
await import("./events/" + file);
8081
}),
8182
);
83+
84+
// Attempt the garbage collection every hour
85+
setInterval(
86+
() => {
87+
Bun.gc(true);
88+
},
89+
60 * 60 * 1000,
90+
);

0 commit comments

Comments
 (0)