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
GIVEAWAY ฤร KแบพT THรC NGฦฏแปI CHIแบพN THแบฎNG Lร "APIHACKERVN"
GIVEAWAY HAS ENDED THE WINNER IS "APIHACKERVN"
GIVEAWAY HAS ENDED THE WINNER IS "APIHACKERVN"
๐7
๐NEW GIVEAWAY SPAM API SOURCE CODE START WHEN 450 MEMBERS ๐
Join fast
๐๐๐
https://t.me/sharecodevn
๐9๐3๐3๐คฏ3
