From 0cc6421328ba62b96ccb4384847fbaed07d0dc69 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 15 May 2020 20:53:24 +0900 Subject: [PATCH] =?UTF-8?q?fix(client):=20Mk:api=E9=96=A2=E6=95=B0?= =?UTF-8?q?=E3=81=AB=E3=83=88=E3=83=BC=E3=82=AF=E3=83=B3=E3=82=92=E6=B8=A1?= =?UTF-8?q?=E3=81=9B=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/scripts/create-aiscript-env.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/scripts/create-aiscript-env.ts b/src/client/scripts/create-aiscript-env.ts index f6429ba92..dfa38be38 100644 --- a/src/client/scripts/create-aiscript-env.ts +++ b/src/client/scripts/create-aiscript-env.ts @@ -23,9 +23,10 @@ export function createAiScriptEnv(vm, opts) { return confirm.canceled ? values.FALSE : values.TRUE; }), 'Mk:api': values.FN_NATIVE(async ([ep, param, token]) => { + if (token) utils.assertString(token); apiRequests++; if (apiRequests > 16) return values.NULL; - const res = await vm.$root.api(ep.value, utils.valToJs(param), token || null); + const res = await vm.$root.api(ep.value, utils.valToJs(param), token ? token.value : null); return utils.jsToVal(res); }), 'Mk:save': values.FN_NATIVE(([key, value]) => {