Commit
·
0bfc263
1
Parent(s):
f1c32f6
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,7 +44,7 @@ async def main():
|
|
| 44 |
if chat_id == sender_id:
|
| 45 |
# Check the last reply to this sender
|
| 46 |
last_reply_time = reply_times.get(str(sender_id), None)
|
| 47 |
-
if last_reply_time is None or time.time() - last_reply_time > 60: # reply only if not replied in the last minute
|
| 48 |
response = f'Hello {sender_name}, I received your message and will reply as soon as possible. Thank you for your understanding.'
|
| 49 |
await client.send_message(chat_id, response)
|
| 50 |
reply_times[str(sender_id)] = time.time() # update the last reply time
|
|
@@ -52,7 +52,7 @@ async def main():
|
|
| 52 |
# Group message
|
| 53 |
elif '@Mohammed_Alakhras' in text:
|
| 54 |
last_reply_time = reply_times.get(str(str(chat_id)+str(sender_id)), None)
|
| 55 |
-
if last_reply_time is None or time.time() - last_reply_time > 60:
|
| 56 |
response = f'Hello {sender_name}, I received your message and will reply as soon as possible. Thank you for your understanding.'
|
| 57 |
await client.send_message(chat_id, response)
|
| 58 |
reply_times[str(str(chat_id)+str(sender_id))] = time.time()
|
|
|
|
| 44 |
if chat_id == sender_id:
|
| 45 |
# Check the last reply to this sender
|
| 46 |
last_reply_time = reply_times.get(str(sender_id), None)
|
| 47 |
+
if last_reply_time is None or time.time() - last_reply_time > 60*15: # reply only if not replied in the last minute
|
| 48 |
response = f'Hello {sender_name}, I received your message and will reply as soon as possible. Thank you for your understanding.'
|
| 49 |
await client.send_message(chat_id, response)
|
| 50 |
reply_times[str(sender_id)] = time.time() # update the last reply time
|
|
|
|
| 52 |
# Group message
|
| 53 |
elif '@Mohammed_Alakhras' in text:
|
| 54 |
last_reply_time = reply_times.get(str(str(chat_id)+str(sender_id)), None)
|
| 55 |
+
if last_reply_time is None or time.time() - last_reply_time > 60*2:
|
| 56 |
response = f'Hello {sender_name}, I received your message and will reply as soon as possible. Thank you for your understanding.'
|
| 57 |
await client.send_message(chat_id, response)
|
| 58 |
reply_times[str(str(chat_id)+str(sender_id))] = time.time()
|