已比較的版本

索引鍵

  • 此行已新增。
  • 此行已移除。
  • 格式已變更。

...

程式碼區塊
import aiohttp
import quart
import traceback

async def get_username():
    async with aiohttp.ClientSession() as session:
        cookie = quart.request.headers["Davinci-Cookie"]
        url = 'https://prod.dvcbot.net'
        async with session.post(
            f"{url}/api/userinfo",
            json={"cookie": cookie},
            verify_ssl=False,
        ) as resp:
            try:
                result = await resp.json()

                return result["username"]
            except Exception as e:
                error_message = traceback.format_exc()

...

參考來源: