-
Notifications
You must be signed in to change notification settings - Fork 3
Colors #25
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
base: master
Are you sure you want to change the base?
Conversation
bbba240 to
fe246be
Compare
| * @param {string} [style=null] | ||
| */ | ||
| privmsg(target, message) { | ||
| privmsg(target, message, background=null, rainbow=false, style=null) { |
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.
I think it'd be better for plugins/root to add colours to the message before calling message functions with it hence the extra three arguments wouldn't be necessary.
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.
Yeah, it would be nice if colours were provided as a util. Maybe something like
const colors = require('../utils/colors.js');
colors("some text").red().bold();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.
I wouldn't know how to do that kind of function, with the chained functions
Add JSDoc comments (placeholders mostly for now) Rename string variables to msg to better reflect their usage
Switched parameters around and ended up re-adding the reply infinite loop and replying in PRIVMSG instead of in the channel (if the message was sent in a channel)�
- Strip the first byte (0x3) to get the color code - Color names are in upper case, so transform the argument for that
When using an empty string, String.prototype.concat doesn't seem to work, but using += does
No description provided.