Skip to content

Commit

Permalink
stable
Browse files Browse the repository at this point in the history
  • Loading branch information
besoeasy authored Nov 22, 2024
1 parent 597af45 commit 73d2756
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
2 changes: 1 addition & 1 deletion func/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
17 changes: 0 additions & 17 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down

0 comments on commit 73d2756

Please sign in to comment.