Skip to content

Commit 88a44a3

Browse files
committed
Auto add name before message which sent from query window
1 parent a1ee96d commit 88a44a3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/irc.coffee

+3-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class IrcBot extends Adapter
7171

7272
bot.addListener 'message', (from, to, message) ->
7373
console.log "From #{from} to #{to}: #{message}"
74-
74+
7575
user = self.userForName from
7676
unless user?
7777
id = (new Date().getTime() / 1000).toString().replace('.','')
@@ -83,6 +83,8 @@ class IrcBot extends Adapter
8383
console.log "#{to} <#{from}> #{message}"
8484
else
8585
user.room = null
86+
unless message.indexOf(to) == 0
87+
message = "#{to}: #{message}"
8688
console.log "msg <#{from}> #{message}"
8789

8890
self.receive new Robot.TextMessage(user, message)

0 commit comments

Comments
 (0)