Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const TelegramBot = require('node-telegram-bot-api')
- const config = require('./config.json')
- const bot = new TelegramBot(config.token, {polling: true})
- bot.on('message', msg => {
- const hr = 'HR'
- if (msg.text === hr) {
- bot.sendMessage(msg.chat.id, 'The contact number of HR is +917312974574')
- }
- const sales = 'Sales'
- if (msg.text === sales) {
- bot.sendMessage(msg.chat.id, 'The contact number of sales team is +13022311373')
- }
- const salesMail = 'SalesMail'
- if (msg.text === salesMail) {
- bot.sendMessage(msg.chat.id, 'The email id to get in contact with the sales team is sales@gammastack.com')
- }
- const mail = 'Mail'
- if (msg.text === mail) {
- bot.sendMessage(msg.chat.id, 'The email id to get in contact with the company is contact@gammastack.com')
- }
- })
- bot.onText(/\/start/, msg => {
- bot.sendMessage(
- msg.chat.id,
- `Hi, ${msg.chat.first_name} ${msg.chat.last_name}.
- Welcome to Gammastack's contact telegram bot.
- Enter 'HR' to get HR's contact number
- Enter 'Sales' to get sales team contact number
- Enter 'SalesMail' to get sales team email id
- Enter 'Mail' to get company's email id`
- )
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement