Fixing a mistake I don't know why I made

This commit is contained in:
Sudo Space 2025-04-28 11:57:13 +03:30
parent 8495908caf
commit 56ebc2c316

View file

@ -14,13 +14,11 @@ checker.on("message", (ctx, next) => {
const user = ctx.session.user;
const link = ctx.message?.text as string;
const match = link.match(/^(https?:\/\/)?(www\.)?/i);
if (!link || !match) {
if (!link || !link.match(/^https?:\/\//)) {
return ctx.reply("Need a link to download media.");
}
const domain = match[1];
const domain = link.match(/https?:\/\/(?:www\.)?([^\/]+)/i)?.at(1);
if (domain == "youtu.be" || domain == "youtube.com") {
if (link.includes("list=")) {