fixing telegram send message

James Peret 7 years ago
parent
commit
bfa279d5e7
2 changed files with 5 additions and 5 deletions
  1. 1 1
      package.json
  2. 4 4
      src/multi-adapter.coffee

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "name": "hubot-multi-adapter",
3
-  "version": "0.1.18",
3
+  "version": "0.1.19",
4 4
   "description": "A Hubot adapter that can receive messages thru socket.io or telegram",
5 5
   "main": "src/multi-adapter",
6 6
   "scripts": {

+ 4 - 4
src/multi-adapter.coffee

@@ -28,15 +28,15 @@ class MultiAdapter extends Adapter
28 28
     super @robot
29 29
 
30 30
   send: (user, strings...) ->
31
-    console.log("Sending response to user " + user.name + " thru " + user.service + ":")
31
+    console.log("Sending response to user " + user.user.name + " thru " + user.user.service + ":")
32
+    console.log(str for str in strings)
32 33
     console.log(user)
33
-    if user.service == "telegram"
34
-      chatId = user.room;
34
+    if user.user.service == "telegram"
35
+      chatId = user.user.room;
35 36
       for str in strings
36 37
         telegramBot.sendMessage(chatId, str);
37 38
     else
38 39
       socket = @sockets[user.room]
39
-      console.log(str for str in strings)
40 40
       for str in strings
41 41
         socket.emit 'message', str
42 42