Rename ircPreventMention to parallelPingFix (#520)

This commit is contained in:
Edward Jones 2019-12-14 14:31:12 -03:00 committed by GitHub
parent 4e807ca34d
commit 8a6dec41c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -88,7 +88,7 @@ First you need to create a Discord bot user, which you can do by following the i
"webhookAvatarURL": "https://robohash.org/{$nickname}" // Default avatar to use for webhook messages
},
"ircNickColor": false, // Gives usernames a color in IRC for better readability (on by default)
"ircPreventMention": true, // Prevents users of both IRC and Discord from being mentioned in IRC when they speak in Discord (off by default)
"parallelPingFix": true, // Prevents users of both IRC and Discord from being mentioned in IRC when they speak in Discord (off by default)
// Makes the bot hide the username prefix for messages that start
// with one of these characters (commands):
"commandCharacters": ["!", "."],

View File

@ -37,7 +37,7 @@ class Bot {
this.discordToken = options.discordToken;
this.commandCharacters = options.commandCharacters || [];
this.ircNickColor = options.ircNickColor !== false; // default to true
this.ircPreventMention = options.ircPreventMention === true; // default: false
this.parallelPingFix = options.parallelPingFix === true; // default: false
this.channels = _.values(options.channelMapping);
this.ircStatusNotices = options.ircStatusNotices;
this.announceSelfJoin = options.announceSelfJoin;
@ -327,7 +327,7 @@ class Bot {
let text = this.parseText(message);
let displayUsername = nickname;
if (this.ircPreventMention) {
if (this.parallelPingFix) {
// Prevent users of both IRC and Discord from
// being mentioned in IRC when they talk in Discord.
displayUsername = `${displayUsername.slice(0, 1)}\u200B${displayUsername.slice(1)}`;

View File

@ -336,8 +336,8 @@ describe('Bot', function () {
}
);
it('should break mentions when ircPreventMention is enabled', function () {
const newConfig = { ...config, ircPreventMention: true };
it('should break mentions when parallelPingFix is enabled', function () {
const newConfig = { ...config, parallelPingFix: true };
this.bot = new Bot(newConfig);
this.bot.connect();