Skip to content

Commit 9970295

Browse files
committed
style: run lint
1 parent ae9090b commit 9970295

File tree

6 files changed

+24
-11
lines changed

6 files changed

+24
-11
lines changed

src/commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,9 +676,9 @@ const commands: Record<string, Command> = {
676676
const query =
677677
platform === "youtube"
678678
? (interaction.options.get("channel_id")
679-
?.value as string)
679+
?.value as string)
680680
: (interaction.options.get("streamer_id")
681-
?.value as string);
681+
?.value as string);
682682

683683
// If the query is empty or not a string, return an empty array
684684
if (!query || typeof query !== "string") {

src/db/botinfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
// Rewriting
1+
// Rewriting

src/events/ready.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ client.once(Events.ClientReady, async (bot) => {
2626

2727
checkIfStreamersAreLive();
2828
setInterval(checkIfStreamersAreLive, config.updateIntervalTwitch as number);
29-
});
29+
});

src/utils/cronJobs.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ActivityType, Guild, PresenceUpdateStatus } from "discord.js";
22

33
import client from "..";
4-
54
import { updateBotInfo } from "../db/botinfo";
65

76
export async function cronUpdateBotInfo() {

src/utils/quickEmbed.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ export enum EmbedType {
77

88
export default async function (query: string, type: EmbedType) {
99
// Wow gonna build an embed no way!
10-
}
10+
}

src/utils/youtube/search.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { InnertubeSearchRequest } from "../../types/youtube";
2+
23
import formatLargeNumber from "../formatLargeNumber";
34

45
export default async function (query: string) {
@@ -33,6 +34,7 @@ export default async function (query: string) {
3334

3435
if (!data || data.length === 0) {
3536
console.error("No search results found for query:", query);
37+
3638
return [];
3739
}
3840

@@ -42,21 +44,33 @@ export default async function (query: string) {
4244
subscribers: number | string;
4345
channel_id: string;
4446
}> = [];
47+
4548
for (const content of data ?? []) {
46-
for (const channel of content?.itemSectionRenderer?.contents ?? []) {
49+
for (const channel of content?.itemSectionRenderer?.contents ??
50+
[]) {
4751
if (channel?.channelRenderer?.channelId) {
4852
channelsResponse.push({
49-
title: channel?.channelRenderer?.longBylineText?.runs?.[0]?.text || "N/A",
50-
handle: channel?.channelRenderer?.subscriberCountText?.simpleText || "N/A",
51-
subscribers: formatLargeNumber(channel?.channelRenderer?.videoCountText?.simpleText),
52-
channel_id: channel?.channelRenderer?.channelId || "N/A",
53+
title:
54+
channel?.channelRenderer?.longBylineText?.runs?.[0]
55+
?.text || "N/A",
56+
handle:
57+
channel?.channelRenderer?.subscriberCountText
58+
?.simpleText || "N/A",
59+
subscribers: formatLargeNumber(
60+
channel?.channelRenderer?.videoCountText
61+
?.simpleText,
62+
),
63+
channel_id:
64+
channel?.channelRenderer?.channelId || "N/A",
5365
});
5466
}
5567
}
5668
}
69+
5770
return channelsResponse;
5871
} catch (err) {
5972
console.error(err);
73+
6074
return [];
6175
}
6276
}

0 commit comments

Comments
 (0)