mirror of
https://github.com/RGBCube/VReplBot
synced 2025-07-24 23:17:44 +00:00
a
This commit is contained in:
parent
fff50afff9
commit
7c94d4c72b
1 changed files with 4 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import json
|
import ast
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from typing import Literal, TYPE_CHECKING
|
from typing import Literal, TYPE_CHECKING
|
||||||
|
|
||||||
|
@ -50,8 +50,8 @@ class Playground(
|
||||||
f"https://play.vlang.io/run",
|
f"https://play.vlang.io/run",
|
||||||
data = { "code": code },
|
data = { "code": code },
|
||||||
) as response:
|
) as response:
|
||||||
body = json.loads(await response.text())
|
body = ast.literal_eval(await response.text())
|
||||||
print(body, type(body))
|
|
||||||
return body["ok"], body["output"]
|
return body["ok"], body["output"]
|
||||||
|
|
||||||
async def test_code(self, code: str) -> tuple[bool, str]:
|
async def test_code(self, code: str) -> tuple[bool, str]:
|
||||||
|
@ -59,7 +59,7 @@ class Playground(
|
||||||
f"https://play.vlang.io/run_test",
|
f"https://play.vlang.io/run_test",
|
||||||
data = { "code": code },
|
data = { "code": code },
|
||||||
) as response:
|
) as response:
|
||||||
body = json.loads(await response.text())
|
body = ast.literal_eval(await response.text())
|
||||||
|
|
||||||
return body["ok"], body["output"]
|
return body["ok"], body["output"]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue