Kvikontent commited on
Commit
61d6479
·
verified ·
1 Parent(s): 798a5ab

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +43 -0
app.py ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from telegram.ext import Updater, CommandHandler
3
+ import telegram
4
+
5
+ st.title("Telegram Group/Channel Info Retriever")
6
+
7
+ channel_id = st.text_input("Enter Telegram Channel/Group ID:")
8
+
9
+ def get_telegram_info(channel_id):
10
+ api_id = "17181071"
11
+ api_hash = "422d63fefdaa0144dc94e9f9bf4261f7"
12
+ bot = telegram.Bot("5991839422:AAHWEwUKG25qQhffz7RZtDwqzb-XRGJxGpo")
13
+
14
+ try:
15
+ chat = bot.get_chat(chat_id=channel_id)
16
+
17
+ title = chat.title
18
+ username = chat.username
19
+ members_count = chat.get_members_count()
20
+ type = chat.type
21
+ name = chat.first_name
22
+ description = chat.description
23
+ permissions = chat.permissions
24
+ photo = chat.get_profile_photos().photos
25
+
26
+ st.write("Title:", title)
27
+ st.write("Username:", username)
28
+ st.write("Members/Subscribers Count:", members_count)
29
+ st.write("Type:", type)
30
+ st.write("Name:", name)
31
+ st.write("Description:", description)
32
+ st.write("Permissions:", permissions)
33
+ st.write("Photo:", photo)
34
+
35
+ except Exception as e:
36
+ st.write("Error fetching information. Make sure the ID is correct and accessible.")
37
+
38
+ if st.button("Submit"):
39
+ get_telegram_info(channel_id)
40
+
41
+ updater = Updater("your_telegram_bot_token")
42
+ channel = updater.bot.get_chat(chat_id=channel_id)
43
+ st.write("Live Channel Subscribers Count:", channel.get_members_count())