mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 19:37:36 +08:00
9 lines
329 B
Python
9 lines
329 B
Python
import aiohttp
|
|
|
|
async def get_myip() -> str:
|
|
try:
|
|
async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(total=10)) as session:
|
|
async with session.get("https://ip.useragentinfo.com/myip") as response:
|
|
return await response.text()
|
|
except Exception as e:
|
|
return '0.0.0.0' |