Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AIscript api returning fields with null that should be undefined #607

Closed
ChaoticLeah opened this issue Mar 27, 2024 · 1 comment
Closed

Comments

@ChaoticLeah
Copy link

Specifically in plugin development, I noticed this in Plugin:register_note_post_interruptor where it passes in a note and directly returning this note object doesn't work since a lot of fields are null that should be undefined.

A temp fix that works for this at least for my case was

Plugin:register_note_post_interruptor(@(note) {
    //My fix for misskeys broken AIscript
    var newPost = {}
    let keys = Obj:keys(note)
    for let i, keys.len {
      let key = keys[i]
      if note[key] != null {
        newPost[key] = note[key] 
      }
    }
    return newPost;
})

However, I think directly returning the note (While not doing anything) should work without error.
I think this could be an issue in other places too and it should be investigated.

@salano-ym
Copy link
Member

That's a bug in Misskey, not Aiscript
Plugin: is implementd in Misskey
see misskey-dev/misskey#9207

@salano-ym salano-ym closed this as not planned Won't fix, can't repro, duplicate, stale Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants