Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,9 @@
|
|
1 |
import os
|
2 |
-
import streamlit as st
|
3 |
from telegram import Update
|
4 |
from telegram.ext import Application, CommandHandler, ContextTypes
|
5 |
import logging
|
6 |
import threading
|
7 |
|
8 |
-
|
9 |
# Enable logging
|
10 |
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)
|
11 |
logger = logging.getLogger(__name__)
|
@@ -30,20 +28,9 @@ application.add_handler(CommandHandler("start", start))
|
|
30 |
def start_polling():
|
31 |
application.run_polling()
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
# Streamlit UI
|
38 |
-
st.title("Telegram Bot on Streamlit")
|
39 |
-
st.write("This bot is running using Streamlit and Python-Telegram-Bot.")
|
40 |
-
|
41 |
-
# Add a text area to show messages (could be used for bot responses)
|
42 |
-
message_area = st.empty()
|
43 |
-
|
44 |
# Start a new thread to run polling
|
45 |
thread = threading.Thread(target=start_polling)
|
46 |
thread.start()
|
47 |
|
48 |
-
# Display information
|
49 |
-
|
|
|
1 |
import os
|
|
|
2 |
from telegram import Update
|
3 |
from telegram.ext import Application, CommandHandler, ContextTypes
|
4 |
import logging
|
5 |
import threading
|
6 |
|
|
|
7 |
# Enable logging
|
8 |
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)
|
9 |
logger = logging.getLogger(__name__)
|
|
|
28 |
def start_polling():
|
29 |
application.run_polling()
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
# Start a new thread to run polling
|
32 |
thread = threading.Thread(target=start_polling)
|
33 |
thread.start()
|
34 |
|
35 |
+
# Display information in terminal/log
|
36 |
+
print("Bot is actively running and polling Telegram.")
|