nekobin.py 374 B

123456789101112
  1. import aiohttp
  2. async def neko(data):
  3. base_url = "https://nekobin.com"
  4. async with aiohttp.ClientSession() as session:
  5. async with session.post(
  6. f"{base_url}/api/documents", json={"content": data}, timeout=3
  7. ) as response:
  8. key = (await response.json())["result"]["key"]
  9. reply = f"{base_url}/{key}"
  10. return reply