@machinat/telegram
v0.6.0
Published
Messenger platform for Machinat.
Downloads
9
Readme
Telegram Platform
Receive events and send messages through Telegram.
Install
npm install @machinat/core @machinat/http @machinat/telegram
# or with yarn
yarn add @machinat/core @machinat/http @machinat/telegram
Docs
Check the platform document and the package reference.
Setup
import Machinat from '@machinat/core';
import Http from '@machinat/http';
import Telegram from '@machinat/telegram';
const {
TELEGRAM_BOT_NAME,
TELEGRAM_BOT_TOKEN,
TELEGRAM_SECRET_PATH,
} = process.env;
const app = Machinat.createApp({
modules: [
Http.initModule({ /* ... */ }),
],
platforms: [
Telegram.intiModule({
webhookPath: '/webhook/telegram',
botName: TELEGRAM_BOT_NAME,
botToken: TELEGRAM_BOT_TOKEN,
secretPath: TELEGRAM_SECRET_PATH,
}),
],
});