From 419cb2259da05e6a5fe33b25e54a933d357fd9e6 Mon Sep 17 00:00:00 2001 From: Benny Date: Tue, 12 Dec 2023 17:50:37 +0100 Subject: [PATCH] auto Local and channel link --- ytdlbot/constant.py | 6 +++--- ytdlbot/limit.py | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ytdlbot/constant.py b/ytdlbot/constant.py index dcb25e2..954b020 100644 --- a/ytdlbot/constant.py +++ b/ytdlbot/constant.py @@ -22,10 +22,10 @@ from utils import get_func_queue class BotText: - start = "Welcome to YouTube Download bot. Type /help for more information." + start = "Welcome to YouTube Download bot. Type /help for more information. Join https://t.me/+OGRC8tp9-U9mZDZl for updates." help = f""" -1. This bot should work at all times. If it doesn't, please wait for a few minutes and try sending the link again. +1. If the bot doesn't work, try again or join https://t.me/+OGRC8tp9-U9mZDZl for updates. 2. Source code: https://github.com/tgbot-collection/ytdlbot """ @@ -40,7 +40,7 @@ class BotText: 3. Refunds are possible, contact me if you need that @BennyThink -4. Paid user can change default download mode to Local mode in settings, which is faster. +4. Download for paid user will be automatically changed to Local mode to avoid queuing. **Price:** valid permanently diff --git a/ytdlbot/limit.py b/ytdlbot/limit.py index ef6ae47..978e6cc 100644 --- a/ytdlbot/limit.py +++ b/ytdlbot/limit.py @@ -171,6 +171,7 @@ class TronTrx: "update payment set token=%s,payment_id=%s where user_id=%s and payment_id like %s", (token_count, f"tron,1,{addr},{index}", user_id, f"tron,%{addr}%"), ) + cur.execute("UPDATE settings SET mode='Local' WHERE user_id=%s", (user_id,)) con.commit() self.central_transfer(addr, index, int(balance * 1_000_000)) logging.debug("Dispatch signal now....") @@ -231,6 +232,7 @@ class Payment(Redis, MySQL): def add_pay_user(self, pay_data: list): self.cur.execute("INSERT INTO payment VALUES (%s,%s,%s,%s,%s)", pay_data) + self.set_user_settings(pay_data[0], "mode", "Local") self.con.commit() def verify_payment(self, user_id: int, unique: str) -> str: