From 25e34c6d518294df94da30bff939e4919dec5822 Mon Sep 17 00:00:00 2001 From: Jacob Gable Date: Fri, 25 Jan 2013 09:10:52 -0600 Subject: [PATCH] Automatically put name in received private messages, fixes #61 --- src/irc.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/irc.coffee b/src/irc.coffee index 1d16e84..fc04fbe 100644 --- a/src/irc.coffee +++ b/src/irc.coffee @@ -183,6 +183,10 @@ class IrcBot extends Adapter bot.addListener 'pm', (nick, message) -> console.log('Got private message from %s: %s', nick, message) + nameLength = options.nick.length + if message.slice(0, nameLength).toLowerCase() != options.nick.toLowerCase() + message = "#{options.nick} #{message}" + self.receive new TextMessage({reply_to: nick, name: nick}, message) bot.addListener 'join', (channel, who) ->