Skip to content

Commit cc46591

Browse files
Update src/db/discord.ts
ok copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 55eb203 commit cc46591

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/db/discord.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,13 @@ export async function discordRemoveGuildTrackingChannel(
286286
): Promise<{ success: boolean; data: [] }> {
287287
console.log(`Removing tracking for ID: ${trackingId}`);
288288

289-
const [platform, platformTrackingId] = trackingId.split(".");
289+
const parts = trackingId.split(".");
290+
if (parts.length !== 2) {
291+
console.error("Invalid trackingId format. Expected format: 'platform.id'");
292+
return { success: false, data: [] };
293+
}
290294

295+
const [platform, platformTrackingId] = parts;
291296
try {
292297
if (platform === Platform.YouTube) {
293298
await db

0 commit comments

Comments
 (0)