How to get inline keyboard for a previously sent message? - bots

Consider the following sequence:
A Telegram bot sends a Message with an inline keyboard with InlineKeyboardMarkup to a specific User
When the user hits one of the buttons of an InlineKeyboardMarkup, bot receives a response with a CallbackQuery
CallbackQuery contains a message object, which represents the original message, which was sent in step 1, but as far as I can see in API docs, Message does not contain any information about InlineKeyboardMarkup or reply_markup.
So is it possible to get InlineKeyboardMarkup of the originally sent Message?
If there is no way of getting it, are there any workarounds in this case?

Update 1 June 2019
Recently Telegram Bot API developers added a new field reply_markup of type InlineKeyboardMarkup to a Message object.
So now you can get previously sent keyboard like that: Update.CallbackQuery.Message.ReplyMarkup

Related

Send private message to a slackbot without other users of the workspace seeing it

How can i send a private message to a bot other without users seeing it on the channel?
Im using node js and the module slackbots. And each time i communicate with the bot it goes something like this: "#robot hello" but everybody on the chat sees it.
Your example is not a direct message, but a so called "mention" in a channel, which is always visible by everyone else in the same channel.
But you can also send a real direct message to a bot user. It works the same like sending a direct message to any user. e.g. click on the plus next to "Direct Messages", select the bot user from the list and click on go. Now you got a direct messaging channel with that user which is 100% private.
Your bot obviously needs to be ready to receive messages via DM in order to respond correctly. e.g if your are using Slack's Events API you need to subscribe to message.im to receive posts in the direct message channel to your bot.
Check out this help desk page on how to send direct messages.
Another approach to communicate "secretly" with your bot user in a channel is slash commands, e.g. by posting /mybot hi in a channel. Both the slash command and respond from your app will not be visible to anyone else in the channel (that is default - but can be changed).

Can I get Dialogflow send a request to my webhook when I trigger an event?

I want to trigger an intent/event in Dialogflow [from my webhook/server] and have Dialogflow send a request to my /webhook instead of just responding to the POST request that I made which triggered the event. Is that possible? I want to send the user a message based on their input in our web application, but the response types could vary greatly so I can't define the message and payload in the DF web panel.
edit: [in brackets]
Yes, Dialogflow can send information to a webhook - it refers to this as fulfillment.
Keep in mind that the JSON sent by Dialogflow will be in its format, not yours, and it expects a reply in its format as well. This reply will include the message to be sent back to the user (the response to the original POST request).

i cant visit the message that i sent with getupdates in telegram bot

I can't visit the message that I sent with getupdates in telegram bot
https://api.telegram.org/bot............./getupdates
how can I visit the messages that I sent with my telegram bot?
I want to show the messages that send with a bot with sendmessage method but I couldn't find it
I can find my the message_id between sent messages but I can't visit the message that bot sent
From your question I couldn't extract in which language you are coding your telegram bot.
In node.js for example, using this package, every message you sent is automatically written to the console. If you only want to review your message that should already do the trick. If you need to store it permanently you'd need to either try to find where the console.log happens and apply your own code or save the console output to a file (like mentioned here). Later on you could for example apply a regex to filter the needed messages.
Note: If you are not using any programming language yet (and are just sending to the telegram API URLs) you have no easy possibility of reviewing your sent messages apart from intercepting the HTTP packets.

Facebook Messenger Chatbot messages tagging (of sorts)

I have a Facebook Messenger bot (written in NodeJS) and a separate control panel where a user can manage the information that the bot is working with (like inventory stock, etc.). One of those things is a log of all conversations between the bot and a visitor. The control panel allows the admin users to send messages to visitors through the bot. There is an input box where they can type in a message and when they click 'Send', the message goes to the bot app, which then sends it back to the user through Send API.
Messages are logged into a database; those going to the bot (from the visitor) are logged when they're received, and those the bot responds with are logged through the 'echo' callback.
The problem with this is that the bot can reply to certain visitor commands (phrases) and tries to perform certain actions based on the input. I'm using Wit.ai for this, but due to the scope of the possible phrases and keywords, the default mode when someone sends a text message is to send it to Wit.ai for processing. However, if an admin user sends the visitor a message from the control panel, the visitor could want to respond to that message (instead of sending a bot command) and that response should not go to the Wit.ai for processing. And due to the sheer scope of possible variations of what can be said, coupled with the fact that they can actually use some of the keywords in the response as well, processing the intent with Wit.ai in that case is too uncertain.
I was wondering if there's a way to somehow identify/mark the source of the messages that the bot sends to the visitor, so when an echo callback comes, I can know if it's, say, from a regular bot routine or from a user-entered reply. Like some additional meta tags that could be sent with the message that would also get returned with the echo, but that doesn't pollute the message itself. Is something like that possible? Or is there a different way I can achieve the same result.
I don't wether that helps you, but Facebook just recently integrated a quite mysterious Tag feature for bots.
https://developers.facebook.com/docs/messenger-platform/send-api-reference/tags

Searching for a way to programmatically receive messages with the ChatConnector

I am currently working with the Microsoft Bot Framework in NodeJS.
I am using a ChatConnector for receiving the input messages and here is my question:
Is there a way to let the connector receive a message programmatically?
The reason why I want this is a forwarding the last message in chat.
I need a line which fakes a user input in the chat.
Thanks for any suggestions.
For example the bot finished a dialog in "mainListen". As a result the user types for example "thanks and now do this". The input is in the message.text as a result available in the first "initStuff". Now i want to be able to use the message input as a input for the mainListen. At this point the user needs to tpye in the commands twice. The "mainListen" is for language understanding to lead into some other dialogs.

Resources