diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-11-18 18:45:58 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-11-18 18:45:58 +0900 |
| commit | ea9aeef9d8790db51c59a99927cd47ea9423be88 (patch) | |
| tree | ec525a4eba3e6eb002cdfd9d6dee294a5533255d /packages/client/src/scripts/aiscript | |
| parent | Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop (diff) | |
| download | sharkey-ea9aeef9d8790db51c59a99927cd47ea9423be88.tar.gz sharkey-ea9aeef9d8790db51c59a99927cd47ea9423be88.tar.bz2 sharkey-ea9aeef9d8790db51c59a99927cd47ea9423be88.zip | |
refactor(client): refactor dialog functions to improve type inference
Diffstat (limited to 'packages/client/src/scripts/aiscript')
| -rw-r--r-- | packages/client/src/scripts/aiscript/api.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/packages/client/src/scripts/aiscript/api.ts b/packages/client/src/scripts/aiscript/api.ts index 20c15d809e..01b8fd05fe 100644 --- a/packages/client/src/scripts/aiscript/api.ts +++ b/packages/client/src/scripts/aiscript/api.ts @@ -9,16 +9,15 @@ export function createAiScriptEnv(opts) { USER_NAME: $i ? values.STR($i.name) : values.NULL, USER_USERNAME: $i ? values.STR($i.username) : values.NULL, 'Mk:dialog': values.FN_NATIVE(async ([title, text, type]) => { - await os.dialog({ + await os.alert({ type: type ? type.value : 'info', title: title.value, text: text.value, }); }), 'Mk:confirm': values.FN_NATIVE(async ([title, text, type]) => { - const confirm = await os.dialog({ + const confirm = await os.confirm({ type: type ? type.value : 'question', - showCancelButton: true, title: title.value, text: text.value, }); |