discord-irc
Advanced tools
Comparing version 2.6.1 to 2.6.2
# Changelog | ||
This project adheres to [Semantic Versioning](http://semver.org/). | ||
## [2.6.2] - 2018-09-19 | ||
### Changed | ||
* Upgraded dependencies. | ||
## [2.6.1] - 2018-05-11 | ||
@@ -5,0 +9,0 @@ ### Changed |
@@ -17,6 +17,2 @@ 'use strict'; | ||
var _winston = require('winston'); | ||
var _winston2 = _interopRequireDefault(_winston); | ||
var _discord = require('discord.js'); | ||
@@ -26,2 +22,6 @@ | ||
var _logger = require('./logger'); | ||
var _logger2 = _interopRequireDefault(_logger); | ||
var _errors = require('./errors'); | ||
@@ -111,3 +111,3 @@ | ||
connect() { | ||
_winston2.default.debug('Connecting to IRC and Discord'); | ||
_logger2.default.debug('Connecting to IRC and Discord'); | ||
this.discord.login(this.discordToken); | ||
@@ -140,3 +140,3 @@ | ||
} else { | ||
_winston2.default.warn('Cannot convert message encoding; you may encounter corrupted characters with non-English text.\n' + 'For information on how to fix this, please see: https://github.com/Throne3d/node-irc#character-set-detection'); | ||
_logger2.default.warn('Cannot convert message encoding; you may encounter corrupted characters with non-English text.\n' + 'For information on how to fix this, please see: https://github.com/Throne3d/node-irc#character-set-detection'); | ||
} | ||
@@ -151,8 +151,8 @@ } | ||
this.discord.on('ready', () => { | ||
_winston2.default.info('Connected to Discord'); | ||
_logger2.default.info('Connected to Discord'); | ||
}); | ||
this.ircClient.on('registered', message => { | ||
_winston2.default.info('Connected to IRC'); | ||
_winston2.default.debug('Registered event: ', message); | ||
_logger2.default.info('Connected to IRC'); | ||
_logger2.default.debug('Registered event: ', message); | ||
this.autoSendCommands.forEach(element => { | ||
@@ -164,11 +164,11 @@ this.ircClient.send(...element); | ||
this.ircClient.on('error', error => { | ||
_winston2.default.error('Received error event from IRC', error); | ||
_logger2.default.error('Received error event from IRC', error); | ||
}); | ||
this.discord.on('error', error => { | ||
_winston2.default.error('Received error event from Discord', error); | ||
_logger2.default.error('Received error event from Discord', error); | ||
}); | ||
this.discord.on('warn', warning => { | ||
_winston2.default.warn('Received warn event from Discord', warning); | ||
_logger2.default.warn('Received warn event from Discord', warning); | ||
}); | ||
@@ -198,3 +198,3 @@ | ||
} else { | ||
_winston2.default.warn(`No channelUsers found for ${channel} when ${oldNick} changed.`); | ||
_logger2.default.warn(`No channelUsers found for ${channel} when ${oldNick} changed.`); | ||
} | ||
@@ -205,3 +205,3 @@ }); | ||
this.ircClient.on('join', (channelName, nick) => { | ||
_winston2.default.debug('Received join:', channelName, nick); | ||
_logger2.default.debug('Received join:', channelName, nick); | ||
if (!this.ircStatusNotices) return; | ||
@@ -217,3 +217,3 @@ if (nick === this.ircClient.nick && !this.announceSelfJoin) return; | ||
this.ircClient.on('part', (channelName, nick, reason) => { | ||
_winston2.default.debug('Received part:', channelName, nick, reason); | ||
_logger2.default.debug('Received part:', channelName, nick, reason); | ||
if (!this.ircStatusNotices) return; | ||
@@ -223,3 +223,3 @@ const channel = channelName.toLowerCase(); | ||
if (nick === this.ircClient.nick) { | ||
_winston2.default.debug('Deleting channelUsers as bot parted:', channel); | ||
_logger2.default.debug('Deleting channelUsers as bot parted:', channel); | ||
delete this.channelUsers[channel]; | ||
@@ -231,3 +231,3 @@ return; | ||
} else { | ||
_winston2.default.warn(`No channelUsers found for ${channel} when ${nick} parted.`); | ||
_logger2.default.warn(`No channelUsers found for ${channel} when ${nick} parted.`); | ||
} | ||
@@ -238,3 +238,3 @@ this.sendExactToDiscord(channel, `*${nick}* has left the channel (${reason})`); | ||
this.ircClient.on('quit', (nick, reason, channels) => { | ||
_winston2.default.debug('Received quit:', nick, channels); | ||
_logger2.default.debug('Received quit:', nick, channels); | ||
if (!this.ircStatusNotices || nick === this.ircClient.nick) return; | ||
@@ -244,3 +244,3 @@ channels.forEach(channelName => { | ||
if (!this.channelUsers[channel]) { | ||
_winston2.default.warn(`No channelUsers found for ${channel} when ${nick} quit, ignoring.`); | ||
_logger2.default.warn(`No channelUsers found for ${channel} when ${nick} quit, ignoring.`); | ||
return; | ||
@@ -254,3 +254,3 @@ } | ||
this.ircClient.on('names', (channelName, nicks) => { | ||
_winston2.default.debug('Received names:', channelName, nicks); | ||
_logger2.default.debug('Received names:', channelName, nicks); | ||
if (!this.ircStatusNotices) return; | ||
@@ -266,14 +266,14 @@ const channel = channelName.toLowerCase(); | ||
this.ircClient.on('invite', (channel, from) => { | ||
_winston2.default.debug('Received invite:', channel, from); | ||
_logger2.default.debug('Received invite:', channel, from); | ||
if (!this.invertedMapping[channel]) { | ||
_winston2.default.debug('Channel not found in config, not joining:', channel); | ||
_logger2.default.debug('Channel not found in config, not joining:', channel); | ||
} else { | ||
this.ircClient.join(channel); | ||
_winston2.default.debug('Joining channel:', channel); | ||
_logger2.default.debug('Joining channel:', channel); | ||
} | ||
}); | ||
if (_winston2.default.level === 'debug') { | ||
if (_logger2.default.level === 'debug') { | ||
this.discord.on('debug', message => { | ||
_winston2.default.debug('Received debug event from Discord', message); | ||
_logger2.default.debug('Received debug event from Discord', message); | ||
}); | ||
@@ -339,3 +339,3 @@ } | ||
_winston2.default.debug('Channel Mapping', channelName, this.channelMapping[channelName]); | ||
_logger2.default.debug('Channel Mapping', channelName, this.channelMapping[channelName]); | ||
if (ircChannel) { | ||
@@ -362,3 +362,3 @@ const fromGuild = message.guild; | ||
patternMap.side = 'Discord'; | ||
_winston2.default.debug('Sending command message to IRC', ircChannel, text); | ||
_logger2.default.debug('Sending command message to IRC', ircChannel, text); | ||
// if (prelude) this.ircClient.say(ircChannel, prelude); | ||
@@ -377,3 +377,3 @@ if (this.formatCommandPrelude) { | ||
text = Bot.substitutePattern(this.formatIRCText, patternMap); | ||
_winston2.default.debug('Sending message to IRC', ircChannel, text); | ||
_logger2.default.debug('Sending message to IRC', ircChannel, text); | ||
this.ircClient.say(ircChannel, text); | ||
@@ -387,3 +387,3 @@ } | ||
_winston2.default.debug('Sending attachment URL to IRC', ircChannel, urlMessage); | ||
_logger2.default.debug('Sending attachment URL to IRC', ircChannel, urlMessage); | ||
this.ircClient.say(ircChannel, urlMessage); | ||
@@ -403,3 +403,3 @@ }); | ||
if (!discordChannel) { | ||
_winston2.default.info('Tried to send a message to a channel the bot isn\'t in: ', discordChannelName); | ||
_logger2.default.info('Tried to send a message to a channel the bot isn\'t in: ', discordChannelName); | ||
return null; | ||
@@ -477,3 +477,3 @@ } | ||
patternMap.side = 'IRC'; | ||
_winston2.default.debug('Sending command message to Discord', `#${discordChannel.name}`, text); | ||
_logger2.default.debug('Sending command message to Discord', `#${discordChannel.name}`, text); | ||
if (this.formatCommandPrelude) { | ||
@@ -557,3 +557,3 @@ const prelude = Bot.substitutePattern(this.formatCommandPrelude, patternMap); | ||
if (webhook) { | ||
_winston2.default.debug('Sending message to Discord via webhook', withMentions, channel, '->', `#${discordChannel.name}`); | ||
_logger2.default.debug('Sending message to Discord via webhook', withMentions, channel, '->', `#${discordChannel.name}`); | ||
const avatarURL = this.getDiscordAvatar(author, channel); | ||
@@ -564,3 +564,3 @@ webhook.client.sendMessage(withMentions, { | ||
avatarURL | ||
}).catch(_winston2.default.error); | ||
}).catch(_logger2.default.error); | ||
return; | ||
@@ -574,3 +574,3 @@ } | ||
const withAuthor = Bot.substitutePattern(this.formatDiscord, patternMap); | ||
_winston2.default.debug('Sending message to Discord', withAuthor, channel, '->', `#${discordChannel.name}`); | ||
_logger2.default.debug('Sending message to Discord', withAuthor, channel, '->', `#${discordChannel.name}`); | ||
discordChannel.send(withAuthor); | ||
@@ -584,3 +584,3 @@ } | ||
_winston2.default.debug('Sending special message to Discord', text, channel, '->', `#${discordChannel.name}`); | ||
_logger2.default.debug('Sending special message to Discord', text, channel, '->', `#${discordChannel.name}`); | ||
discordChannel.send(text); | ||
@@ -587,0 +587,0 @@ } |
@@ -8,16 +8,5 @@ #!/usr/bin/env node | ||
var _winston = require('winston'); | ||
var _winston2 = _interopRequireDefault(_winston); | ||
var _helpers = require('./helpers'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/* istanbul ignore next */ | ||
if (process.env.NODE_ENV === 'development') { | ||
_winston2.default.level = 'debug'; | ||
} | ||
/* istanbul ignore next */ | ||
if (!module.parent) { | ||
@@ -24,0 +13,0 @@ require('./cli').default(); |
{ | ||
"name": "discord-irc", | ||
"version": "2.6.1", | ||
"version": "2.6.2", | ||
"description": "Connects IRC and Discord channels by sending messages back and forth.", | ||
@@ -40,11 +40,11 @@ "keywords": [ | ||
"check-env": "1.3.0", | ||
"commander": "2.15.1", | ||
"discord.js": "11.3.2", | ||
"irc-colors": "1.4.2", | ||
"commander": "2.18.0", | ||
"discord.js": "11.4.2", | ||
"irc-colors": "1.4.3", | ||
"irc-formatting": "1.0.0-rc3", | ||
"irc-upd": "0.9.0", | ||
"irc-upd": "0.10.0", | ||
"lodash": "^4.17.4", | ||
"simple-markdown": "0.4.0", | ||
"simple-markdown": "0.4.2", | ||
"strip-json-comments": "2.0.1", | ||
"winston": "2.4.2" | ||
"winston": "3.1.0" | ||
}, | ||
@@ -63,3 +63,3 @@ "devDependencies": { | ||
"mocha": "^5.0.0", | ||
"nyc": "^11.0.3", | ||
"nyc": "^13.0.1", | ||
"sinon": "^4.0.1", | ||
@@ -66,0 +66,0 @@ "sinon-chai": "^2.8.0" |
@@ -72,3 +72,8 @@ # discord-irc [](https://travis-ci.org/reactiflux/discord-irc) [](https://coveralls.io/github/reactiflux/discord-irc?branch=master) | ||
"floodProtection": false, // On by default | ||
"floodProtectionDelay": 1000 // 500 by default | ||
"floodProtectionDelay": 1000, // 500 by default | ||
"port": "6697", // 6697 by default | ||
"secure": true, // enable SSL, false by default | ||
"sasl": true, // false by default | ||
"username": "test", // nodeirc by default | ||
"password": "p455w0rd" // empty by default | ||
}, | ||
@@ -75,0 +80,0 @@ "format": { // Optional custom formatting options |
49358
15
661
146
+ Added@colors/colors@1.6.0(transitive)
+ Added@types/triple-beam@1.3.5(transitive)
+ Addedasync@2.6.4(transitive)
+ Addedchardet@0.5.0(transitive)
+ Addedcolor@3.2.1(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedcolor-string@1.9.1(transitive)
+ Addedcolornames@1.1.1(transitive)
+ Addedcolors@1.4.0(transitive)
+ Addedcolorspace@1.1.4(transitive)
+ Addedcommander@2.18.0(transitive)
+ Addeddiagnostics@1.1.1(transitive)
+ Addeddiscord.js@11.4.2(transitive)
+ Addedenabled@1.0.2(transitive)
+ Addedenv-variable@0.0.6(transitive)
+ Addedfast-safe-stringify@2.1.1(transitive)
+ Addedfecha@2.3.34.2.3(transitive)
+ Addedirc-colors@1.4.3(transitive)
+ Addedirc-upd@0.10.0(transitive)
+ Addedis-arrayish@0.3.2(transitive)
+ Addedis-stream@1.1.0(transitive)
+ Addedkuler@1.0.1(transitive)
+ Addedlogform@1.10.02.7.0(transitive)
+ Addedms@2.1.3(transitive)
+ Addedone-time@0.0.4(transitive)
+ Addedprism-media@0.0.3(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsafe-stable-stringify@2.5.0(transitive)
+ Addedsimple-markdown@0.4.2(transitive)
+ Addedsimple-swizzle@0.2.2(transitive)
+ Addedtext-hex@1.0.0(transitive)
+ Addedtriple-beam@1.4.1(transitive)
+ Addedwinston@3.1.0(transitive)
+ Addedwinston-transport@4.9.0(transitive)
- Removedasync@1.0.0(transitive)
- Removedcolors@1.0.3(transitive)
- Removedcommander@2.15.1(transitive)
- Removedcycle@1.0.3(transitive)
- Removeddiscord.js@11.3.2(transitive)
- Removedeyes@0.1.8(transitive)
- Removedirc-colors@1.4.2(transitive)
- Removedirc-upd@0.9.0(transitive)
- Removedisstream@0.1.2(transitive)
- Removedjschardet@1.6.0(transitive)
- Removedprism-media@0.0.2(transitive)
- Removedsimple-markdown@0.4.0(transitive)
- Removedwinston@2.4.2(transitive)
Updatedcommander@2.18.0
Updateddiscord.js@11.4.2
Updatedirc-colors@1.4.3
Updatedirc-upd@0.10.0
Updatedsimple-markdown@0.4.2
Updatedwinston@3.1.0