Telegram ChatBot using IBM Watson Conversation

This flow uses TelegramBot node and IBM Watson Conversation

[{"id":"3e0a95af.e5f08a","type":"function","z":"8c07c84c901460eb","name":"Save context","func":"context.flow.chatId = msg.payload.chatId;\ncontext.flow.type = msg.payload.type;\nmsg.payload = msg.payload.content;\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":100,"wires":[["24ebd36b.04d1e4"]]},{"id":"24ebd36b.04d1e4","type":"watson-conversation-v1","z":"8c07c84c901460eb","name":"","workspaceid":"0a1df2e1-faa4-4607-9641-63e8b56a46c5","multiuser":false,"context":true,"empty-payload":false,"service-endpoint":"https://api.us-south.assistant.watson.cloud.ibm.com/instances/d38f0242-f900-4813-90c0-136552c8a516","timeout":"","optout-learning":false,"x":480,"y":100,"wires":[["3c133c0c.807744"]]},{"id":"3c133c0c.807744","type":"function","z":"8c07c84c901460eb","name":"Restore context","func":"msg.payload.chatId = context.flow.chatId;\nmsg.payload.type = context.flow.type;\nmsg.payload.content = msg.payload.output.generic[0].text;\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":660,"y":100,"wires":[["106e3553196519f9"]]},{"id":"10222f18.29e139","type":"function","z":"8c07c84c901460eb","name":"Not authorized user","func":"msg.payload.content = \"You're not authorized user\";\nreturn msg;","outputs":1,"noerr":0,"x":490,"y":180,"wires":[["106e3553196519f9"]]},{"id":"c61665b5.dc1d8","type":"comment","z":"8c07c84c901460eb","name":"Read.me","info":"1) Create a Watson Conversation on IBM Cloud (https://www.bluemix.net)\n2) Create a Telegram Bot:\n   Open web.telegram.org\n   find BotFather (contact)\n   send /newbot\n   Give a name for your bot (Botfather will ask it)\n   Give a user name for it, which should have in the end \"Bot\"\n   The BotFather will give you a token.\n3) Baixe o nó node-red-contrib-telegrambot\n   Configure o nó receiver com o token dado\n   pelo Botfather\n   ","x":100,"y":40,"wires":[]},{"id":"fe94e8a123af9817","type":"telegram receiver","z":"8c07c84c901460eb","name":"","bot":"15f92a8235375ec0","saveDataDir":"","filterCommands":false,"x":120,"y":100,"wires":[["3e0a95af.e5f08a"],["10222f18.29e139"]]},{"id":"106e3553196519f9","type":"telegram sender","z":"8c07c84c901460eb","name":"","bot":"15f92a8235375ec0","haserroroutput":false,"outputs":1,"x":860,"y":100,"wires":[[]]},{"id":"15f92a8235375ec0","type":"telegram bot","botname":"gama-fiap","usernames":"","chatids":"","baseapiurl":"","updatemode":"polling","pollinterval":"300","usesocks":false,"sockshost":"","socksprotocol":"socks5","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","botpath":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false}]

Flow Info

Created 6 years, 11 months ago
Updated 9 months, 1 week ago
Rating: 5 3

Owner

Actions

Rate:

Node Types

Core
  • comment (x1)
  • function (x3)
Other

Tags

  • telegram
  • watson
  • conversation
  • IBM
  • TelegramBot
  • IBMWatson
  • WatsonConversation
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option