diff --git a/CHANGELOG.md b/CHANGELOG.md index 93fd4a7d8..ee2f11b15 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 f049a51b9..032853f7a 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',