From 1b59667e43a8d200660e98fb82bb07e661e9f2d7 Mon Sep 17 00:00:00 2001 From: Lexie Love Date: Wed, 11 Jan 2023 13:01:03 -0600 Subject: [PATCH] add gitignore, avoid a null index error and update ytdl_core --- .gitignore | 1 + commands/play.ts | 2 +- configs.ts.example | 11 +++++++++++ discordeno-audio-plugin-main/deps.ts | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 configs.ts.example diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..589d6f4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +./configs.ts \ No newline at end of file diff --git a/commands/play.ts b/commands/play.ts index 2278252..05fb527 100644 --- a/commands/play.ts +++ b/commands/play.ts @@ -58,7 +58,7 @@ export async function play(bot: Bot, interaction: Interaction, _args?) { } // TODO: maybe switch to ytdl and not have to use the deno youtube library? const result = await player.pushQuery(interaction.user.username, href); - if(parsed_url.href.indexOf("youtube.com") !== -1 || parsed_url.href.indexOf("youtu.be") !== -1 && result[0].title) { + if(result && parsed_url.href.indexOf("youtube.com") !== -1 || parsed_url.href.indexOf("youtu.be") !== -1 && result[0].title) { await editOriginalInteractionResponse(bot, interaction.token, addedToQueueResponse(interaction, result[0].title)); } } else { diff --git a/configs.ts.example b/configs.ts.example new file mode 100644 index 0000000..2aba090 --- /dev/null +++ b/configs.ts.example @@ -0,0 +1,11 @@ +export const configs = { + project_root: "/permanent-waves", + discord_token: "", + allowed_text_channels: [ + "server:bot-channel" + ], + allowed_voice_channels: [ + "server:general" + ], + embed_color: 5639994 +}; diff --git a/discordeno-audio-plugin-main/deps.ts b/discordeno-audio-plugin-main/deps.ts index 03d4a1c..ddb5d33 100644 --- a/discordeno-audio-plugin-main/deps.ts +++ b/discordeno-audio-plugin-main/deps.ts @@ -6,7 +6,7 @@ export { default as ytdl, getInfo, downloadFromInfo, -} from "https://deno.land/x/ytdl_core@v0.1.1/mod.ts"; +} from "https://deno.land/x/ytdl_core@v0.1.2/mod.ts"; export { ytDownload } from "https://deno.land/x/yt_download@1.1/mod.ts"; export type { VideoFormat } from "https://deno.land/x/ytdl_core@v0.1.0/src/types.ts"; export { default as YouTube } from "https://deno.land/x/youtube_sr@v4.3.4-deno/mod.ts";