@jackdbd/eleventy-plugin-telegram
Eleventy plugin that sends messages to a Telegram chat of your choice.
Table of Contents
Installation
npm install --save-dev @jackdbd/eleventy-plugin-telegram
Usage
const { telegramPlugin } = require('@jackdbd/eleventy-plugin-telegram')
module.exports = function (eleventyConfig) {
// some eleventy configuration...
eleventyConfig.addPlugin(telegramPlugin, {
chatId: 'YOUR_TELEGRAM_CHAT_ID',
token: 'YOUR_TELEGRAM_BOT_TOKEN',
textBeforeBuild: '11ty have just started building my site',
textAfterBuild: '11ty has finished building my awesome site'
})
// some more eleventy configuration...
}
See Telegram sendMessage API method for formatting options.
Configuration
Required parameters
Parameter | Explanation |
---|---|
chatId |
Your Telegram chat ID. |
token |
Your Telegram Bot token. If you forgot the API token of a Telegram bot you created, you can retrieve it at any time using BotFather. Just go to BotFather > bot list > API token . |
Options
Option | Default | Explanation |
---|---|---|
textBeforeBuild |
🏎️ 11ty has <b>started</b> building the site |
Text message to send when Eleventy starts building the site. |
textAfterBuild |
🏁 11ty has <b>finished</b> building the site |
Text message to send when Eleventy finishes building the site. |
ℹ️ a Telegram message can be 1-4096 characters long, after entities parsing. See formatting options here.