telme/lib/flows/send_message.ts

9 lines
357 B
TypeScript
Raw Normal View History

'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' });
}
}