mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 18:07:31 -07:00
feat(aiscript): Better env vars
This commit is contained in:
parent
3e128d67a1
commit
d61d46e1c4
1 changed files with 3 additions and 2 deletions
|
@ -3,8 +3,9 @@ import { utils, values } from '@syuilo/aiscript';
|
||||||
export function createAiScriptEnv(vm, opts) {
|
export function createAiScriptEnv(vm, opts) {
|
||||||
let apiRequests = 0;
|
let apiRequests = 0;
|
||||||
return {
|
return {
|
||||||
USER_ID: values.STR(vm.$store.state.i.id),
|
USER_ID: vm.$store.getters.isSignedIn ? values.STR(vm.$store.state.i.id) : values.NULL,
|
||||||
USER_USERNAME: values.STR(vm.$store.state.i.username),
|
USER_NAME: vm.$store.getters.isSignedIn ? values.STR(vm.$store.state.i.name) : values.NULL,
|
||||||
|
USER_USERNAME: vm.$store.getters.isSignedIn ? values.STR(vm.$store.state.i.username) : values.NULL,
|
||||||
'Mk:dialog': values.FN_NATIVE(async ([title, text, type]) => {
|
'Mk:dialog': values.FN_NATIVE(async ([title, text, type]) => {
|
||||||
await vm.$root.dialog({
|
await vm.$root.dialog({
|
||||||
type: type ? type.value : 'info',
|
type: type ? type.value : 'info',
|
||||||
|
|
Loading…
Reference in a new issue