Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class Bot {
this.discordToken = options.discordToken;
this.commandCharacters = options.commandCharacters || [];
this.ircNickColor = options.ircNickColor !== false; // default to true
this.ircNickColorIndex = (options.ircNickColorIndex < NICK_COLORS.length) ?
options.ircNickColorIndex :
false;
this.channels = _.values(options.channelMapping);
this.ircStatusNotices = options.ircStatusNotices;
this.announceSelfJoin = options.announceSelfJoin;
Expand Down Expand Up @@ -317,7 +320,10 @@ class Bot {
let text = this.parseText(message);
let displayUsername = nickname;
if (this.ircNickColor) {
const colorIndex = (nickname.charCodeAt(0) + nickname.length) % NICK_COLORS.length;
// If colorIndex is set in conf use that value
const colorIndex = this.ircNickColorIndex ?
this.ircNickColorIndex :
(nickname.charCodeAt(0) + nickname.length) % NICK_COLORS.length;
displayUsername = irc.colors.wrap(NICK_COLORS[colorIndex], nickname);
}

Expand Down