From 73d2756617da4ec94f958ed3f59cd6003e6f847a Mon Sep 17 00:00:00 2001 From: Aman Singh Katal Date: Fri, 22 Nov 2024 07:18:23 +0530 Subject: [PATCH] stable --- func/utils.js | 2 +- index.js | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/func/utils.js b/func/utils.js index bbf745b..17fa31e 100644 --- a/func/utils.js +++ b/func/utils.js @@ -5,7 +5,7 @@ const tempdir = require("os").tmpdir(); const saveDirectory = path.join(tempdir, "downloads"); let teleariaPort = 6799; -let teleariaURL = "http://localhost:6799"; +let teleariaURL = process.env.TUNNELURL || "http://localhost:6799"; const crypto = require("crypto"); diff --git a/index.js b/index.js index 2b9999a..97755b2 100755 --- a/index.js +++ b/index.js @@ -194,19 +194,6 @@ const handleClean = (ctx) => { } }; -const handleSetURL = (ctx, newURL) => { - if (!newURL || !newURL.startsWith("http")) { - ctx.reply( - "Invalid URL. Please provide a valid URL starting with http or https." - ); - return; - } - - teleariaURL = newURL; // Update the URL - ctx.reply(`TeleAria URL has been updated to: ${teleariaURL}`); -}; - -// Message handler bot.on("message", async (ctx) => { if (ctx.message.text) { try { @@ -218,10 +205,6 @@ bot.on("message", async (ctx) => { console.log(`@${ctx.from.username} (ID: ${ctx.from.id}): ${text}`); switch (lowerCaseCommand) { - case "/seturl": - if (trimmedArgs.length > 0) handleSetURL(ctx, trimmedArgs[0]); - else ctx.reply("Please provide a new URL."); - break; case "/clean": handleClean(ctx); break;