From 024546206d17b728b67769091b4aa700df2181e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Wed, 25 Oct 2023 17:46:04 +0900 Subject: [PATCH] =?UTF-8?q?feat(AiScript):=20Mk:nyaize()=20=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20(#12136)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(AiScript): Mk:nyaize * Update Changelog * Fix relative path --- CHANGELOG.md | 1 + packages/frontend/src/scripts/aiscript/api.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f875b4b70..c693748f67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ - Feat: プラグイン・テーマを外部サイトから直接インストールできるようになりました - 外部サイトでの実装が必要です。詳細は Misskey Hub をご覧ください https://misskey-hub.net/docs/advanced/publish-on-your-website.html +- Feat: AiScript関数`Mk:nyaize()`が追加されました - Fix: 投稿フォームでのユーザー変更がプレビューに反映されない問題を修正 ### Server diff --git a/packages/frontend/src/scripts/aiscript/api.ts b/packages/frontend/src/scripts/aiscript/api.ts index 032853f7ad..fb7ab924b7 100644 --- a/packages/frontend/src/scripts/aiscript/api.ts +++ b/packages/frontend/src/scripts/aiscript/api.ts @@ -9,6 +9,7 @@ import { $i } from '@/account.js'; import { miLocalStorage } from '@/local-storage.js'; import { customEmojis } from '@/custom-emojis.js'; import { url, lang } from '@/config.js'; +import { nyaize } from '@/scripts/nyaize.js'; export function createAiScriptEnv(opts) { return { @@ -71,5 +72,9 @@ export function createAiScriptEnv(opts) { 'Mk:url': values.FN_NATIVE(() => { return values.STR(window.location.href); }), + 'Mk:nyaize': values.FN_NATIVE(([text]) => { + utils.assertString(text); + return values.STR(nyaize(text.value)); + }), }; }