Alright, thanks for the help!
Cepheus
Posts
-
Serverhooks with external platform -
Serverhooks with external platformExample:
plugin.json
{ "id": "nodebb-plugin-nubhook", "name": "nubHook", "description": "blablabla", "url": "removed for priv", "library": "./library.js", "hooks": [ { "hook": "action:post.save", "method": "discordHooker" }, { "hook": "static:app.load", "method": "init" } ], "scripts": [ "lib/main.js" ] }
library.js
var NubHook = { discordHooker: function(postData) { //send to discord plox } }; module.exports = NubHook;
-
Serverhooks with external platformMy code is extremely mangled at the moment.
Basically what I am attempting to do is whenever a user posts I want an update to be pushed to a Discord channel. I have the Discord hooks working perfect. But sending the data through the nodebb hook is becoming a task.
The only information I require is how to push the data to Discord from the nodebb server side.
Should I be using nodejs http to send the data?
-
Serverhooks with external platformOr is there a hook that I am missing that fires clientside when the user posts a new message? I have tried "action:composer.post.new" which fires when you click new or reply not submit.
-
Serverhooks with external platformOk I have been slamming my head against this for a few days now since I am fairly new to socket.io and the nodebb framework. Hoping I can get some ideas.
Basically all I am trying to do is get a nodebb serverhook to work with another platforms hook. The hook I am using is action:post.save.
I have my plugin.json serverhook calling to my library.js fine. The problem is trying to pass the data to the other platform.
I can do it all day long client side with something like:
$.post( url, embed2 );I guess my question really is, how the heck can I "post (socket.io equivalent?)" from my plugin in a serverside script?
I have been searching for hours and I bet I missed something. Any help is appreciated.