Update code in endpoints/whatsapp.get.py

This commit is contained in:
Backend IM Bot 2025-03-25 12:56:49 +00:00
parent 31b6754c7b
commit f165641c48

View File

@ -0,0 +1,27 @@
from fastapi import APIRouter
import random
african_countries = [
"Nigeria", "Egypt", "South Africa", "Kenya", "Ethiopia",
"Ghana", "Tanzania", "Uganda", "Algeria", "Morocco",
"Zimbabwe", "Zambia", "Rwanda", "Senegal", "Mali",
"Angola", "Mozambique", "Cameroon", "Niger", "Malawi"
]
router = APIRouter()
@router.get("/whatsapp")
async def get_random_country():
"""Returns random African country"""
country = random.choice(african_countries)
return {
"method": "GET",
"_verb": "get",
"country": country,
"message": f"Random African country: {country}",
"features": {
"total_countries": len(african_countries),
"region": "Africa"
}
}