Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -26,6 +26,11 @@ client = Client(
|
|
26 |
|
27 |
link_storage = {}
|
28 |
|
|
|
|
|
|
|
|
|
|
|
29 |
def generate_callback_data(user_id, query):
|
30 |
identifier = hashlib.md5(query.encode()).hexdigest()
|
31 |
callback_data = f"audiodownload_{user_id}_{identifier}"
|
@@ -34,6 +39,8 @@ def generate_callback_data(user_id, query):
|
|
34 |
|
35 |
@client.on_message(filters.command("start") & filters.private)
|
36 |
async def welcome_start(client: Client, message: Message):
|
|
|
|
|
37 |
keyboard = InlineKeyboardMarkup(
|
38 |
[
|
39 |
[
|
@@ -72,6 +79,8 @@ def is_tiktok_url(url):
|
|
72 |
@client.on_message(filters.text & filters.private)
|
73 |
async def tiktok_downloader(client: Client, message: Message):
|
74 |
if message.text:
|
|
|
|
|
75 |
query_url = message.text
|
76 |
if not is_tiktok_url(query_url):
|
77 |
return await message.reply_text("Invalid link")
|
|
|
26 |
|
27 |
link_storage = {}
|
28 |
|
29 |
+
NOT_ALLOWED_NON_PROGRAMMER = [
|
30 |
+
466019692, # @myexcid,
|
31 |
+
6477856957, # @hellozdev
|
32 |
+
]
|
33 |
+
|
34 |
def generate_callback_data(user_id, query):
|
35 |
identifier = hashlib.md5(query.encode()).hexdigest()
|
36 |
callback_data = f"audiodownload_{user_id}_{identifier}"
|
|
|
39 |
|
40 |
@client.on_message(filters.command("start") & filters.private)
|
41 |
async def welcome_start(client: Client, message: Message):
|
42 |
+
if message.from_user.id in NOT_ALLOWED_NON_PROGRAMMER:
|
43 |
+
return await message.reply_text("As long as the account is restricted, you will not be able to send messages to bots")
|
44 |
keyboard = InlineKeyboardMarkup(
|
45 |
[
|
46 |
[
|
|
|
79 |
@client.on_message(filters.text & filters.private)
|
80 |
async def tiktok_downloader(client: Client, message: Message):
|
81 |
if message.text:
|
82 |
+
if message.from_user.id in NOT_ALLOWED_NON_PROGRAMMER:
|
83 |
+
return await message.reply_text("As long as the account is restricted, you will not be able to send messages to bots")
|
84 |
query_url = message.text
|
85 |
if not is_tiktok_url(query_url):
|
86 |
return await message.reply_text("Invalid link")
|