Skip to content

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

Closed as not planned

Description

@ChaoticLeah

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.

Activity

  1. salano-ym commented on Mar 27, 2024

    @salano-ym
    Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions