A [Pino v7+ transport](https://getpino.io/#/docs/transports?id=v7-transports) to send message to [Telegram](https://telegram.org/)
npm install pino-telegram-webhookA Pino v7+ transport to send message to Telegram
```
npm install pino-telegram-webhook
`js
const pino = require('pino');
const logger = pino({
transport: {
target: 'pino-telegram-webhook',
level: 'error',
options: {
chatId: -1234567890,
botToken: "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11",
extra: {
parse_mode: "HTML",
},
},
},
})
logger.error('test log!');
`
- chatId: The chat ID of the Telegram channel or group. Required.botToken
- : The bot token of the Telegram bot. Required.verbose
- : Whether to display the log in verbose mode.messageKey
- : The key of the log message. Default is msg. Required if the logger's message key has been changed.extra
- : The extra parameter is optional. Parameters that the method sendMessage supports can be passed to it
The extra parameter is optional. Parameters that the method sendMessage supports can be passed to it
---
If verbose = true, the message will be displayed as`inline fixed-width code
{
"level": 50,
"time": 1721832322878,
"pid": 13522,
"hostname": "fedora",
"msg": ""`
}
---
If verbose = true and parse_mode = "HTML|Markdown|MarkdownV2, the message will be displayed as`jsoninline fixed-width code
{
"level": 50,
"time": 1721832322878,
"pid": 13522,
"hostname": "fedora",
"msg": ""``
}