-
Notifications
You must be signed in to change notification settings - Fork 15
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
Made nickserv less async (fixes #95, part of #144). #172
Conversation
modules/nickserv.js
Outdated
bot.getConfig('nickserv.json', function(err, conf) { | ||
console.log(err); | ||
if(err) return; | ||
module.exports.init = (b) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still needs to be a function, otherwise this.log
won't work.
The bot calls init via something quite close to moduleInit.apply(moduleBot, moduleBot)
Here's the difference I'm meaning: https://runkit.com/euank/5a10b6c0bb407900127d67bd
conf/nickserv.example.json
Outdated
"password" : "dicks" | ||
"nickserv": "nickserv", | ||
"password" : "dicks", | ||
"successtext": "you are now identified for " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps this should be a regexp? still a string in the config, but always passed to new RegExp
and used with .test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
12677f8
to
a95bfda
Compare
Changed arrow func to function for logging. Now using regex for nickserv success message tests.
a95bfda
to
4bf3418
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than the commit message not following the usual module/nickerv:
style prefix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…ale#172) Changed arrow func to function for logging. Now using regex for nickserv success message tests.
Nickserv was previously async enough to identify after all channels were joined. I've now configured the module to retry joining channels if Nickserv sends us a notice with specific text (you are now identified). This isn't quite the workaround described in #95, but it works!
Also added logging in a few spots and removed tabs.
edit: cc #144