GAP172

Untitled

Oct 19th, 2021 (edited)
778
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const message = ctx.reply(
  2.       `${name}`,
  3.       {
  4. reply_markup: {
  5.           inline_keyboard: [
  6.             [{ text: `Смотреть ${type}`, url: url }],
  7.             [
  8.               { text: `Отправить 1 канал`, callback_data: 'KH' },
  9.               { text: `Отправить 2 канал`, callback_data: 'KS' },
  10.             ],
  11.             [{ text: `Отправить во все каналы`, callback_data: 'ALL' }],
  12.           ],
  13.         },
  14.  
  15. // callback
  16.     bot.action('KH', (ctx) => {
  17.       message.then((result) => postToChannel(result.text, ctx));
  18.     });
  19.  
  20.     bot.action('KS', (ctx) => {
  21.       message.then((result) => postToStar(result.text, ctx));
  22.     });
  23.  
  24.     bot.action('ALL', (ctx) => {
  25.       message.then((result) => postToChannel(result.text, ctx));
  26.     });
  27.     // пост в каналы
  28.     const postToChannel = (text, ctx) => {
  29.       ctx.telegram.sendMessage('channel', text, {
  30.         parse_mode: 'html',
  31.         reply_markup: {
  32.           inline_keyboard: [[{ text: `Слушать ${type}`, url: url }]],
  33.         },
  34.       });
  35.     };
Add Comment
Please, Sign In to add comment