Hi.
Maybe this helps? sso-open-ldap
@djensen47 don't think you can turn it off for just one user. I think you will have to modify core to force the reply to bypass the restrictions
@djensen47 said:
but when the user posts a reply with a bot command, the page does not refresh with the new message from the bot. Is there a way I can force a refresh?
Ah, the socket call to emit the event is not in Topics.reply
... you'll need to manually call it:
https://github.com/NodeBB/NodeBB/blob/master/src/socket.io/posts.js#L48
Make sure to structure result
in the format as it is shown several lines above
@julian Thanks for the tip!
What if I want to bypass all of the checks that Topics.reply
makes? Particularly the rate limiting. The code says not to use Post.create
but that would bypass all checks, no?
From where can I get a handle to the current socket?
I have this working with the following …
var result = {
posts: [postData],
privileges: { 'topics:reply': true },
'reputation:disabled': parseInt(Meta.config['reputation:disabled'], 10) === 1,
'downvote:disabled': parseInt(Meta.config['downvote:disabled'], 10) === 1
};
Sockets.in('uid_'+uid).emit('event:new_post', result);
So, it appears to refresh the page with the new post but only if I scroll up or down, which is standard behavior?
Next, I'm not seeing alerts when the bot posts a message. I think this is due to the fact that I've switched to using Posts.create
instead of Topics.reply
@baris said:
Hmm, you could still use
Topics.reply
and after the post is made set thelastposttime
property of the bot user toDate.now() - tenSeconds
so it won't be rate limited.
That and using SocketHelpers
instead of Socket.in
worked like a charm. The bot response is basically instant.
https://github.com/Schamper/nodebb-plugin-botler
Working bot, just needs some love and a configuration page and extra handlers/events added.
@Schamper It hasn't been updated in a year. For what version does this work?
Anyway, mine seems to be working now. It's a purpose specific bot anyway (dice rolling).
@djensen47 yep I noticed that after reading your OP more carefully. The intention of my bot was a 100% configurable bot that would be able to perform actions based on certain events happening and possibly having filters applied to it. It would be waaaay overkill for your use case.
It works in theory but I lost motivation and no one seemed interested in it at the time. If it was actually finished it could easily perform tasks like what you're writing a separate plugin for.