Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. const TelegramBot = require('node-telegram-bot-api')
  2. const config = require('./config.json')
  3.  
  4. const bot = new TelegramBot(config.token, {polling: true})
  5.  
  6. bot.on('message', msg => {
  7. const hr = 'HR'
  8. if (msg.text === hr) {
  9. bot.sendMessage(msg.chat.id, 'The contact number of HR is +917312974574')
  10. }
  11.  
  12. const sales = 'Sales'
  13. if (msg.text === sales) {
  14. bot.sendMessage(msg.chat.id, 'The contact number of sales team is +13022311373')
  15. }
  16.  
  17. const salesMail = 'SalesMail'
  18. if (msg.text === salesMail) {
  19. bot.sendMessage(msg.chat.id, 'The email id to get in contact with the sales team is sales@gammastack.com')
  20. }
  21.  
  22. const mail = 'Mail'
  23. if (msg.text === mail) {
  24. bot.sendMessage(msg.chat.id, 'The email id to get in contact with the company is contact@gammastack.com')
  25. }
  26. })
  27.  
  28. bot.onText(/\/start/, msg => {
  29. bot.sendMessage(
  30. msg.chat.id,
  31. `Hi, ${msg.chat.first_name} ${msg.chat.last_name}.
  32. Welcome to Gammastack's contact telegram bot.
  33. Enter 'HR' to get HR's contact number
  34. Enter 'Sales' to get sales team contact number
  35. Enter 'SalesMail' to get sales team email id
  36. Enter 'Mail' to get company's email id`
  37. )
  38. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement