waline-notification-telegram-bot
v1.0.1
Published
A Waline notification plugin that sends alerts via telegram bot
Maintainers
Readme
waline-notification-telegram-bot
A Waline plugin that provide Telegram Bot spport.
中文文档 | English Doc
How to install
npm install waline-notification-telegram-botHow to use
Edit your Waline File:
indes.js
const Application = require('@waline/vercel');
const Telegram = require('waline-notification-telegram-bot');
module.exports = Application({
plugins: [Telegram],
async postSave(comment) {
// do what ever you want after comment saved
},
});package.json
Add "waline-notification-telegram-bot": "latest" into package.json dependencies.
Environment Variables
TELEGRAM_BOT_TOKEN: Telegram bot token, get it by creating a bot via@BotFather. e.g.9435023322:DKEEOGmREFHKHwSpo-KfsgSnjwUGEHEft0ATELEGRAM_CHAT_ID: Telegram chat id, can be a single user, channel, or group, get it via@userinfobot. e.g.098765432SITE_NAME: Your site name, used for display in notification message.SITE_URL: Your site URL, used for display in notification message.TELEGRAM_TEMPLATE: (optional) Your custom notification template, please refer this document.
The default template as below:
{{site.name|safe}} 有新评论啦
【昵称】:{{self.nick}}
【邮箱】:{{self.mail}}
【内容】:{{self.comment}}
【地址】:{{site.postUrl}}You need redeploy after change environment variables.
