From 09dfb9bde3fc49a76c8aa7efd6e3741c5d452fed Mon Sep 17 00:00:00 2001 From: FineArchs <133759614+FineArchs@users.noreply.github.com> Date: Sat, 30 Sep 2023 09:39:21 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20AiScript=E3=81=A7=E3=83=9B=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=81=AE=E3=82=A2=E3=83=89=E3=83=AC=E3=82=B9=E3=82=92?= =?UTF-8?q?=E5=8F=82=E7=85=A7=E3=81=A7=E3=81=8D=E3=82=8B=E5=AE=9A=E6=95=B0?= =?UTF-8?q?=20(#11924)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add HOST_URL * Update CHANGELOG.md * tweak --------- Co-authored-by: syuilo --- CHANGELOG.md | 1 + packages/frontend/src/scripts/aiscript/api.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93fd4a7d8b..ee2f11b156 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - Enhance: ノートの翻訳機能の利用可否をロールで設定可能に ### Client +- Enhance: AiScriptでホストのアドレスを参照する定数`SERVER_URL`を追加 - Enhance: モデレーションログ機能の強化 - Enhance: ローカリゼーションの更新 diff --git a/packages/frontend/src/scripts/aiscript/api.ts b/packages/frontend/src/scripts/aiscript/api.ts index f049a51b93..032853f7ad 100644 --- a/packages/frontend/src/scripts/aiscript/api.ts +++ b/packages/frontend/src/scripts/aiscript/api.ts @@ -8,7 +8,7 @@ import * as os from '@/os.js'; import { $i } from '@/account.js'; import { miLocalStorage } from '@/local-storage.js'; import { customEmojis } from '@/custom-emojis.js'; -import { lang } from '@/config.js'; +import { url, lang } from '@/config.js'; export function createAiScriptEnv(opts) { return { @@ -17,6 +17,7 @@ export function createAiScriptEnv(opts) { USER_USERNAME: $i ? values.STR($i.username) : values.NULL, CUSTOM_EMOJIS: utils.jsToVal(customEmojis.value), LOCALE: values.STR(lang), + SERVER_URL: values.STR(url), 'Mk:dialog': values.FN_NATIVE(async ([title, text, type]) => { await os.alert({ type: type ? type.value : 'info',