add HOST_URL

This commit is contained in:
FineArchs 2023-09-30 00:23:40 +09:00 committed by GitHub
parent 5edc885c22
commit a676d3c947
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -8,7 +8,7 @@ import * as os from '@/os.js';
import { $i } from '@/account.js'; import { $i } from '@/account.js';
import { miLocalStorage } from '@/local-storage.js'; import { miLocalStorage } from '@/local-storage.js';
import { customEmojis } from '@/custom-emojis.js'; import { customEmojis } from '@/custom-emojis.js';
import { lang } from '@/config.js'; import { url, lang } from '@/config.js';
export function createAiScriptEnv(opts) { export function createAiScriptEnv(opts) {
return { return {
@ -17,6 +17,7 @@ export function createAiScriptEnv(opts) {
USER_USERNAME: $i ? values.STR($i.username) : values.NULL, USER_USERNAME: $i ? values.STR($i.username) : values.NULL,
CUSTOM_EMOJIS: utils.jsToVal(customEmojis.value), CUSTOM_EMOJIS: utils.jsToVal(customEmojis.value),
LOCALE: values.STR(lang), LOCALE: values.STR(lang),
HOST_URL: values.STR(url),
'Mk:dialog': values.FN_NATIVE(async ([title, text, type]) => { 'Mk:dialog': values.FN_NATIVE(async ([title, text, type]) => {
await os.alert({ await os.alert({
type: type ? type.value : 'info', type: type ? type.value : 'info',