add gitignore, avoid a null index error and update ytdl_core

This commit is contained in:
Lexie Love 2023-01-11 13:01:03 -06:00
parent 6533e85d92
commit 1b59667e43
4 changed files with 14 additions and 2 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
./configs.ts

View File

@ -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 {

11
configs.ts.example Normal file
View File

@ -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
};

View File

@ -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";