telme/lib/flows/send_message.ts
Sagi Dayan 2db82b708d [WIP]
- Changed from js to ts
 - Added implementation for profiles
 - Can also be used as a node_module
2020-03-22 18:09:33 -04:00

9 lines
357 B
TypeScript

'use strict';
const TelegramBot = require('node-telegram-bot-api');
import { IProfileConfig } from '../config/config';
export default class SendMessage {
static async send(config: IProfileConfig, msg: string) {
const bot = new TelegramBot(config.bot_token);
return await bot.sendMessage(config.chat_id, `${msg}`, { parse_mode: 'Markdown' });
}
}