Skip to content

Commit

Permalink
feat(AiScript): Mk:nyaize() を追加 (#12136)
Browse files Browse the repository at this point in the history
* feat(AiScript): Mk:nyaize

* Update Changelog

* Fix relative path
  • Loading branch information
kakkokari-gtyih authored Oct 25, 2023
1 parent 4dd4a11 commit 0245462
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- Feat: プラグイン・テーマを外部サイトから直接インストールできるようになりました
- 外部サイトでの実装が必要です。詳細は Misskey Hub をご覧ください
https://misskey-hub.net/docs/advanced/publish-on-your-website.html
- Feat: AiScript関数`Mk:nyaize()`が追加されました
- Fix: 投稿フォームでのユーザー変更がプレビューに反映されない問題を修正

### Server
Expand Down
5 changes: 5 additions & 0 deletions packages/frontend/src/scripts/aiscript/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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));
}),
};
}

0 comments on commit 0245462

Please sign in to comment.