Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const message = ctx.reply(
- `${name}`,
- {
- reply_markup: {
- inline_keyboard: [
- [{ text: `Смотреть ${type}`, url: url }],
- [
- { text: `Отправить 1 канал`, callback_data: 'KH' },
- { text: `Отправить 2 канал`, callback_data: 'KS' },
- ],
- [{ text: `Отправить во все каналы`, callback_data: 'ALL' }],
- ],
- },
- // callback
- bot.action('KH', (ctx) => {
- message.then((result) => postToChannel(result.text, ctx));
- });
- bot.action('KS', (ctx) => {
- message.then((result) => postToStar(result.text, ctx));
- });
- bot.action('ALL', (ctx) => {
- message.then((result) => postToChannel(result.text, ctx));
- });
- // пост в каналы
- const postToChannel = (text, ctx) => {
- ctx.telegram.sendMessage('channel', text, {
- parse_mode: 'html',
- reply_markup: {
- inline_keyboard: [[{ text: `Слушать ${type}`, url: url }]],
- },
- });
- };
Add Comment
Please, Sign In to add comment