Plugin Development

Suggested Topics

  • 0 Votes
    1 Posts

    What is the best way to write to the notes field of a flag? I am writing a plugin that when a post/user is flagged it will send the information to a ticketing system and return a ticket id. I want to write that ID to the flag and close the flag.

  • 1 Votes
    5 Posts

    I was interested in that functionality as well, so I developed my own version of it.
    It can be found here and already is in nbbpm (can be installed from ACP by searching for nodebb-plugin-category-queue)
    It has some basic ACP (list of categories with options to queue new topics from them or not queue), and only works on new topics, not all posts (that is actually by design, as - after all - you have done the work on filtering posts already. It's just that I was looking for only sending new topics to queue)

  • Best way of forking a plugin?

    Unsolved Plugin Development
    0 Votes
    2 Posts

    Hey there! Thanks for investigating a fix 😄

    You can fork the plugin on the GitHub pages, and when you are ready you can submit a pull request to merge those changes back into the upstream repository. Then your work can be shared to everybody!

  • 0 Votes
    2 Posts

    Call toggle active then restart or reload nodebb.

    var Plugins = require.main.require('./src/plugins'); var Meta = require.main.require('./src/meta'); var pluginid = 'nodebb-plugin-yourplugin'; Plugins.isActive(pluginid, function (err, isActive) { if (err) return console.log(err); if (isActive) Plugins.toggleActive(pluginid, Meta.restart); // or Meta.reload })
  • 1 Votes
    10 Posts

    Yeah nodebb plugins are npm modules so they need to have a package.json file. The plugin.json file is just for nodebb.