Repository: reactiflux/discord-irc
Pull request #293 (2017-09-03 03:05:44)

[Doppins] Upgrade dependency simple-markdown to ^0.3.1
Hi!

A new version was just released of `simple-markdown`, so [Doppins](https://doppins.com)
has upgraded your project's dependency ranges.

Make sure that it doesn't break anything, and happy merging! :shipit:

---
### Upgraded simple-markdown from `^0.2.1` to `^0.3.0`



coveralls: 
[![Coverage Status](https://coveralls.io/builds/13103499/badge)](https://coveralls.io/builds/13103499)

Coverage remained the same at 99.254% when pulling **d4cd414b701b68fdd897e57c704da36097b81cb3 on doppins/simple-markdown-from-0.3.0-below-0.4.0** into **345da09fcf5195c502c6bfb89bd34cc90ad643e0 on master**.

doppins-bot: An additional new version was just released of `simple-markdown`, so we've added an
extra commit upgrading your range to `^0.3.1`.

Hope that's alright!
— [Doppins](https://doppins.com)

coveralls: 
[![Coverage Status](https://coveralls.io/builds/13258241/badge)](https://coveralls.io/builds/13258241)

Coverage remained the same at 99.254% when pulling **dddf038ce402cd8d802dd98bde3602572df2d06d on doppins/simple-markdown-from-0.3.0-below-0.4.0** into **345da09fcf5195c502c6bfb89bd34cc90ad643e0 on master**.


Patch:
diff --git a/README.md b/README.md
index d95835a..b8585fa 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # discord-irc [![Build Status](https://travis-ci.org/reactiflux/discord-irc.svg?branch=master)](https://travis-ci.org/reactiflux/discord-irc) [![Coverage Status](https://coveralls.io/repos/github/reactiflux/discord-irc/badge.svg?branch=master)](https://coveralls.io/github/reactiflux/discord-irc?branch=master)
 
-> Connects [Discord](https://discordapp.com/) and IRC channels by sending messages back and forth.
+> Connects [Discord](https://discordapp.com/) and [IRC](https://www.ietf.org/rfc/rfc1459.txt) channels by sending messages back and forth.
 
 ## Example
 ![discord-irc](http://i.imgur.com/oI6iCrf.gif)
diff --git a/lib/bot.js b/lib/bot.js
index 2587178..31402db 100644
--- a/lib/bot.js
+++ b/lib/bot.js
@@ -86,6 +86,8 @@ class Bot {
       floodProtection: true,
       floodProtectionDelay: 500,
       retryCount: 10,
+      autoRenick: true,
+      // options specified in the configuration file override the above defaults
       ...this.ircOptions
     };
 
@@ -248,7 +250,7 @@ class Bot {
   }
 
   isCommandMessage(message) {
-    return this.commandCharacters.indexOf(message[0]) !== -1;
+    return this.commandCharacters.some(prefix => message.startsWith(prefix));
   }
 
   static substitutePattern(message, patternMapping) {
diff --git a/package.json b/package.json
index 1003498..b3cb885 100644
--- a/package.json
+++ b/package.json
@@ -39,11 +39,11 @@
     "check-env": "1.3.0",
     "commander": "2.11.0",
     "discord.js": "11.1.0",
-    "irc-upd": "0.7.0",
+    "irc-upd": "0.8.0",
     "irc-colors": "^1.3.2",
     "irc-formatting": "^1.0.0-rc3",
     "lodash": "^4.17.4",
-    "simple-markdown": "^0.2.1",
+    "simple-markdown": "^0.3.1",
     "strip-json-comments": "2.0.1",
     "winston": "2.3.1"
   },


Test patch:
diff --git a/test/bot.test.js b/test/bot.test.js
index 23c9610..293fdde 100644
--- a/test/bot.test.js
+++ b/test/bot.test.js
@@ -480,6 +480,30 @@ describe('Bot', function () {
     ClientStub.prototype.say.getCall(1).args.should.deep.equal(['#irc', text]);
   });
 
+  it('should support multi-character command prefixes', function () {
+    const bot = new Bot({ ...config, commandCharacters: ['@@'] });
+    const text = '@@test command';
+    const message = {
+      content: text,
+      mentions: { users: [] },
+      channel: {
+        name: 'discord'
+      },
+      author: {
+        username: 'test',
+        id: 'not bot id'
+      },
+      guild: this.guild
+    };
+    bot.connect();
+
+    bot.sendToIRC(message);
+    ClientStub.prototype.say.getCall(0).args.should.deep.equal([
+      '#irc', 'Command sent from Discord by test:'
+    ]);
+    ClientStub.prototype.say.getCall(1).args.should.deep.equal(['#irc', text]);
+  });
+
   it('should hide usernames for commands to Discord', function () {
     const username = 'ircuser';
     const text = '!command';