Skip to content

Commit 0ef0f09

Browse files
committed
Improve config check and warning message around encodings
1 parent ec56eca commit 0ef0f09

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/bot.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,12 @@ class Bot {
9292
};
9393

9494
// default encoding to UTF-8 so messages to Discord aren't corrupted
95-
if (!('encoding' in ircOptions)) {
95+
if (!Object.prototype.hasOwnProperty.call(ircOptions, 'encoding')) {
9696
if (irc.canConvertEncoding()) {
9797
ircOptions.encoding = 'utf-8';
9898
} else {
99-
logger.warn('Cannot convert message encoding; you may encounter corrupted characters with non-English text.');
99+
logger.warn('Cannot convert message encoding; you may encounter corrupted characters with non-English text.\n' +
100+
'For information on how to fix this, please see: https://github.com/Throne3d/node-irc#character-set-detection');
100101
}
101102
}
102103

0 commit comments

Comments
 (0)