Skip to content

Commit

Permalink
Automatically put name in received private messages, fixes nandub#61
Browse files Browse the repository at this point in the history
  • Loading branch information
jgable committed Jan 25, 2013
1 parent 64413c4 commit 25e34c6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/irc.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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) ->
Expand Down

0 comments on commit 25e34c6

Please sign in to comment.