Spaces:
Sleeping
Sleeping
import streamlit as st | |
from telegram.ext import Updater, CommandHandler | |
import telegram | |
st.title("Telegram Group/Channel Info Retriever") | |
channel_id = st.text_input("Enter Telegram Channel/Group ID:") | |
def get_telegram_info(channel_id): | |
api_id = "17181071" | |
api_hash = "422d63fefdaa0144dc94e9f9bf4261f7" | |
bot = telegram.Bot("5991839422:AAHWEwUKG25qQhffz7RZtDwqzb-XRGJxGpo") | |
try: | |
chat = bot.get_chat(chat_id=channel_id) | |
title = chat.title | |
username = chat.username | |
members_count = chat.get_members_count() | |
ctype = chat.type | |
name = chat.first_name | |
description = chat.description | |
permissions = chat.permissions | |
photo = chat.get_profile_photos().photos | |
st.write("Title:", title) | |
st.write("Username:", username) | |
st.write("Members/Subscribers Count:", members_count) | |
st.write("Type:", ctype) | |
st.write("Name:", name) | |
st.write("Description:", description) | |
st.write("Permissions:", permissions) | |
st.write("Photo:", photo) | |
except Exception as e: | |
st.write("Error fetching information. Make sure the ID is correct and accessible.") | |
if st.button("Submit"): | |
get_telegram_info(channel_id) | |
updater = Updater("your_telegram_bot_token") | |
channel = updater.bot.get_chat(chat_id=channel_id) | |
st.write("Live Channel Subscribers Count:", channel.get_members_count()) |