1
Fork 0
mirror of https://github.com/RGBCube/VReplBot synced 2025-07-24 23:17:44 +00:00
This commit is contained in:
RGBCube 2023-02-03 21:59:09 +03:00
parent 8c4d1c5c3e
commit ede57775f4

View file

@ -1,5 +1,6 @@
from __future__ import annotations from __future__ import annotations
import json
from io import BytesIO from io import BytesIO
from typing import Literal, TYPE_CHECKING from typing import Literal, TYPE_CHECKING
@ -62,8 +63,7 @@ class Playground(
f"https://play.vlang.io/{type}", f"https://play.vlang.io/{type}",
data = { "code": code }, data = { "code": code },
) as response: ) as response:
body = await response.json() body = json.loads(await response.text())
print(body)
text = sanitize_str_for_codeblock(body["output"]) text = sanitize_str_for_codeblock(body["output"])
if len(text) + 7 > 2000: if len(text) + 7 > 2000: