N
N
nikitinars2018-05-28 18:08:36
JavaScript
nikitinars, 2018-05-28 18:08:36

How to send a message from 1 bot to another bot?

const inline_keyboard = [
[
{
text: 'Forward',
callback_data: 'forward'
},
{
text: 'Reply',
callback_data: 'reply'
}
],
[
{
text: 'Edit',
callback_data: 'edit'
},
{
text: 'Delete',
callback_data: 'delete'
}
]
]
bot.on('callback_query', query => {
const { chat, message_id, text } = query.message
switch (query.data) {
case 'forward':
// where, from where, what
bot.forwardMessage(chat.id, chat.id, message_id)
break
}
bot.answerCallbackQuery({
callback_query_id: query.id
})
})
bot.onText(/\/start/, (msg, [source, match]) => {
const chatId = msg.chat.id
bot.sendMessage(chatId, 'Keyboard', {
reply_markup: {
inline_keyboard
}
})
})
I send the message 'Keyboard' from my chat to my own chat bot.forwardMessage(chat.id, chat.id, message_id) ,
How can I send a message to another bot? . For example, I need to receive a message from a user, and send this message to another bot, how can I implement this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg, 2018-05-28
@OlegPyatakov

By means of Telegram in any way. Bots cannot see messages from other bots: Bots FAQ
You need to organize your information exchange outside of Telegram.

N
nikitinars, 2018-05-28
@nikitinars

5b0c1d581ae79902417832.png
Can't understand channel insert syntax
https://core.telegram.org/bots/api Documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question