import requests
from telegram import Update
from telegram.ext import Application, CommandHandler, ContextTypes
BOT_TOKEN = "7997907072:AAEcUopih7hkMY5iHb29DIkDKjMNFOLtE1g"
async def get_covid_stats(country: str) -> str:
try:
url = f"https://disease.sh/v3/covid-19/countries/{country}"
response = requests.get(url, timeout=5)
response.raise_for_status()
data = response.json()
return (
f"π¦ **COVID-19 Stats for {data['country']}**ππ»\n\n"
f"π **Total Cases**: {data['cases']:,}\n"
f"π₯ **Active Cases**: {data['active']:,}\n"
f"π **Deaths**: {data['deaths']:,}\n"
f"β **Recovered**: {data['recovered']:,}\n"
f"π **Last Updated**: {data['updated'] // 1000}"
)
except requests.exceptions.RequestException:
return "β οΈ Invalid country name.\n Example: `/covid India`"
except KeyError:
return "β Error in fetching data.\n Please try again later."
async def covid_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
if not context.args:
await update.message.reply_text("β Please specify a country.\n Example: `/covid india`", parse_mode="Markdown")
return
country = " ".join(context.args).strip().lower()
covid_info = await get_covid_stats(country)
await update.message.reply_text(covid_info, parse_mode="Markdown")
def main():
application = Application.builder().token(BOT_TOKEN).build()
application.add_handler(CommandHandler("covid", covid_command))
print("π€ Bot is running...")
application.run_polling()
if __name__ == "__main__":
main()
πͺπΉπ¬π«π°π»- @daddy_chips
π4π2
source spam.py
1.9 KB
β€6π₯2
VISIT API SOURCE CODE GIVEAWAY ππ€
1 MEMBERS WIN π
GIVEAWAY START βΆοΈ
TYPE VOTE βοΈ
STARTING : 105 SUBSCRIBERS
ENDING : 250 SUBSCRIBERS
NEED 60% PROOF π§Ύ
CHANNEL LINK ποΈ
https://t.me/sharecodevn
SEND NAME FAST π
@tanhung11231
π6π6π₯2
Free Code π»π³ pinned Β«VISIT API SOURCE CODE GIVEAWAY ππ€ 1 MEMBERS WIN π GIVEAWAY START βΆοΈ TYPE VOTE βοΈ STARTING : 105 SUBSCRIBERS ENDING : 250 SUBSCRIBERS NEED 60% PROOF π§Ύ CHANNEL LINK ποΈ https://t.me/sharecodevn SEND NAME FAST π @tanhung11231Β»
β€ΝΝΝΝπππβγππΦαππγπ
β€8β‘2π2π₯1π₯±1
ChΓ o mα»i ngΖ°α»i, tΓ¬nh hΓ¬nh lΓ nhΓ³m TαΊ₯n HΖ°ng cΕ© ΔΓ£ bα» ban.NhΓ³m ΔΓ£ gαΊ§n tα»i cα»t mα»c 4000 thΓ nh viΓͺn nhΖ°ng ΔΓ£ bα» xoΓ‘.VΓ¬ vαΊy tΓ΄i ΔΓ£ tαΊ‘o 1 nhΓ³m khΓ‘c vΓ bαΊ―t ΔαΊ§u lαΊ‘i tα»« con sα» 0.
Tham gia tαΊ‘i ΔΓ’y
Hi everyone, the situation is that the old Tan Hung group has been banned. The group was close to the 4000 member milestone but was deleted. So I created another group and started from zero.
Join here
https://t.me/checkinfo123
Tham gia tαΊ‘i ΔΓ’y
Hi everyone, the situation is that the old Tan Hung group has been banned. The group was close to the 4000 member milestone but was deleted. So I created another group and started from zero.
Join here
https://t.me/checkinfo123
π₯5π1
