Created
June 5, 2019 06:19
-
-
Save SilencerWeb/b86cb489ff05d7bf6aaaee53730b73aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // post options | |
| const options = { | |
| reply_markup: { | |
| inline_keyboard: [ | |
| [ | |
| { | |
| text: 'Remove caption', | |
| callback_data: 'remove_post_caption', | |
| }, | |
| ], | |
| [ | |
| { | |
| text: 'Approve', | |
| callback_data: 'approve_post', | |
| }, | |
| { | |
| text: 'Dismiss', | |
| callback_data: 'dismiss_post', | |
| }, | |
| ], | |
| ], | |
| }; | |
| } | |
| // bot.js | |
| import Telegraf from 'telegraf'; | |
| import Telegram from 'telegraf/telegram'; | |
| import { BOT_TOKEN } from './constants/constants'; | |
| const telegrafBot = new Telegraf(BOT_TOKEN); | |
| const telegramBot = new Telegram(BOT_TOKEN); | |
| telegrafBot.action('remove_post_caption', (context) => { | |
| console.log(context); | |
| }); | |
| telegrafBot.action('approve_post', (context) => { | |
| console.log(context); | |
| }); | |
| telegrafBot.action('dismiss_post', (context) => { | |
| console.log(context); | |
| }); | |
| export { telegrafBot, telegramBot }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment