Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -13,8 +13,8 @@ import uuid
|
|
13 |
from io import BytesIO
|
14 |
|
15 |
|
16 |
-
|
17 |
-
import
|
18 |
|
19 |
|
20 |
from werkzeug.utils import secure_filename
|
@@ -676,9 +676,17 @@ def view_image():
|
|
676 |
|
677 |
|
678 |
|
|
|
679 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
680 |
|
681 |
-
|
682 |
|
683 |
|
684 |
|
|
|
13 |
from io import BytesIO
|
14 |
|
15 |
|
16 |
+
|
17 |
+
import telepot
|
18 |
|
19 |
|
20 |
from werkzeug.utils import secure_filename
|
|
|
676 |
|
677 |
|
678 |
|
679 |
+
bot = telepot.Bot('bot7766407698:AAGZHEbUuiOri4_YzZ7hDPSD6U8MGMXXSnA')
|
680 |
|
681 |
+
def handle_message(msg):
|
682 |
+
content_type, chat_type, chat_id = telepot.glance(msg)
|
683 |
+
if content_type == 'text':
|
684 |
+
command = msg['text']
|
685 |
+
if command == '/start':
|
686 |
+
username = msg['from']['first_name']
|
687 |
+
bot.sendMessage(chat_id, f"Привет, {username}!")
|
688 |
|
689 |
+
bot.message_loop(handle_message)
|
690 |
|
691 |
|
692 |
|