node.js - 使用 Telegram bot(telegraf),nodejs发送markdown文本

标签 node.js telegram telegram-bot telegraf

如何使用nodejs上的telegraf库通过电报bot发送markdown文本?

最佳答案

const token = 'YOUR TOKEN';
const Telegraf = require('telegraf')
const extra = require('telegraf/extra')
const markup = extra.markdown()

const telegram = new Telegraf(token)

telegram.telegram.sendMessage('there chat id', 'your message', markup)

关于node.js - 使用 Telegram bot(telegraf),nodejs发送markdown文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53022863/

相关文章:

node.js - Nodejs 回调机制——哪个线程处理回调?

javascript - 为什么我的递归函数没有返回最终结果?

api - Telegram 机器人可以搜索用户联系人吗?

Telegram Bot API : obtain all groups my bot is a member of

javascript - 在 Node 应用程序和客户端 javascript 之间共享配置

javascript - 使用 jinja2 兼容模式预编译 Nunjucks 模板

python - 无法在 Telegram Bot API 中使用 "send_message"

php - Telegram Bot SSL 错误 : SSL error {error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed}

google-chrome - 有没有办法将消息附加到 tg ://handler url for telegram links on webpages?

Python 远程机器人 API。为什么我的机器人会对每条消息使用react?