Fixing a mistake I don't know why I made
This commit is contained in:
parent
8495908caf
commit
56ebc2c316
1 changed files with 2 additions and 4 deletions
|
@ -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=")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue