Spaces:
Running
Running
Commit
·
5abede8
1
Parent(s):
cc4a315
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,15 @@ import socks
|
|
5 |
import time
|
6 |
import os
|
7 |
import requests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
def download_file(url, filename):
|
10 |
response = requests.get(url)
|
@@ -12,6 +21,29 @@ def download_file(url, filename):
|
|
12 |
file.write(response.content)
|
13 |
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
|
17 |
|
@@ -67,7 +99,7 @@ async def main():
|
|
67 |
elif username in text:
|
68 |
last_reply_time = reply_times.get(str(str(chat_id)+str(sender_id)), None)
|
69 |
if last_reply_time is None or time.time() - last_reply_time > 60*5:
|
70 |
-
response = f'Hello <a href="tg://user?id={sender_id}">{sender_name}</a> @ <a href="https://t.me/c/{chat_id}">{chat.title}</a>,\n
|
71 |
await client.send_message(chat_id, response, parse_mode='HTML')
|
72 |
reply_times[str(str(chat_id)+str(sender_id))] = time.time()
|
73 |
|
|
|
5 |
import time
|
6 |
import os
|
7 |
import requests
|
8 |
+
import random
|
9 |
+
|
10 |
+
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
|
18 |
def download_file(url, filename):
|
19 |
response = requests.get(url)
|
|
|
21 |
file.write(response.content)
|
22 |
|
23 |
|
24 |
+
RndMssgs = [
|
25 |
+
"I've received your message. I'll get back to you as soon as possible.",
|
26 |
+
"I appreciate your patience and understanding.",
|
27 |
+
"Your message has been received. I'll respond shortly.",
|
28 |
+
"I'm currently unavailable, but I'll reply as soon as I can.",
|
29 |
+
"Your message has been received and it's important to us.",
|
30 |
+
"I'm away at the moment. Rest assured, I'll respond to your message soon.",
|
31 |
+
"Your message is received. Thank you for your understanding.",
|
32 |
+
"I've received your message and will respond at my earliest convenience.",
|
33 |
+
"I've received your message. I'll make sure to reply as soon as possible.",
|
34 |
+
"I'm currently out offline, but I'll get back to you shortly.",
|
35 |
+
"I've received your message. I'll get back to you soon.",
|
36 |
+
"I'm not available right now, but I've received your message.",
|
37 |
+
"Thank you for contacting me. I'll respond as soon as I can.",
|
38 |
+
"I'm currently busy, but I'll make sure to reply to your message as soon as possible.",
|
39 |
+
"Your message has been received. I'll get back to you shortly.",
|
40 |
+
"Thank you for your patience. I'll respond as soon as I can.",
|
41 |
+
"I've received your message and will get back to you shortly.",
|
42 |
+
"Your message has been received. Thank you for waiting.",
|
43 |
+
"I'm currently on a break, but I've received your message and will respond soon."
|
44 |
+
]
|
45 |
+
|
46 |
+
|
47 |
|
48 |
|
49 |
|
|
|
99 |
elif username in text:
|
100 |
last_reply_time = reply_times.get(str(str(chat_id)+str(sender_id)), None)
|
101 |
if last_reply_time is None or time.time() - last_reply_time > 60*5:
|
102 |
+
response = f'Hello <a href="tg://user?id={sender_id}">{sender_name}</a> @ <a href="https://t.me/c/{chat_id}">{chat.title}</a>,\n {random.choice(RndMssgs)} 😊'
|
103 |
await client.send_message(chat_id, response, parse_mode='HTML')
|
104 |
reply_times[str(str(chat_id)+str(sender_id))] = time.time()
|
105 |
|