Skip to content

Instantly share code, notes, and snippets.

@SilencerWeb
Created June 5, 2019 06:19
Show Gist options
  • Select an option

  • Save SilencerWeb/b86cb489ff05d7bf6aaaee53730b73aa to your computer and use it in GitHub Desktop.

Select an option

Save SilencerWeb/b86cb489ff05d7bf6aaaee53730b73aa to your computer and use it in GitHub Desktop.
// 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