We are using telegram bot webhook method and our website ssl is CloudFlare free ssl, telegram bot works and telegram call our csharp api, but text of messages that telegram send to our api is empty.
Anybody could guide me about this issue.
Had the same problem in php project. In the documentation, they write that request will be via HTTPS POST. But I received empty data. Solution: use file_get_contents(php://input) instead trying to get data from $_POST
Related
I made a facebook chatbot with dialogflow. My problem is that some users write messages to my bot that are longer than 256 characters.
Dialogflow just throws an error that the character size exceeded. As the result, the user has no answer.
I don't expect dialogflow to process the input. I just want to get this information in my backend, so I can send the user to the live chat.
Please, say me it is possible (and how ;) ).
By following this you will be able to set the custom webhook => Webhook setup
Make this server live with Ngrok with temporary later on you can migrate to your server
Now you will get event in which you will find your message sent from facebook messenger.
you can write simple JS function to send only 256 character to Dialogflow Functions
str.substring(0,255)
and send it to detectIntent in dialogflow function.
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.
I set the webhook of my Telegram Bot and it seems to work fine, but the bot doesn't reply when I try to write him. The code of the file I indicated as webhook is correct (I checked it with getupdates method) and the server where it's hosted has the SSL certificate.
Trying to see the result of the method getWebhookInfo I checked up that the error was "Wrong response from the webhook: 410 Gone".
Anyone could help me to find out where the problem is?
I recommend you to copy the url you received from getWebhookInfo and then POST some valid JSON to it (e.g. on linux with curl, examples here: Telegram Guide).
WRON RESPONSE FROM WEBHOOK indicates that there is a problem with your web server configuration or something elso on the way in.
"410 Gone" is returned by your webserver, so maybe your .httaccess config is wrong (if using Apachee).
My FB-NodeJS-API prototype is not working correctly because my webhook is receiving the bot respond which is then sent to API.AI.
I need to set a condition where only a user's message should be received on the webhook request or only user's message should be sent to API.AI.
Can anyone advise me on this?
Can you explain the problem better? Please add the relevant code.
The bot response should go the user, not the webhook. The user input will come to the webhook.
I would suggest getting the bot to work without API.AI first and then adding support. My bot is in node.js so you may just want to jump to the source code.
For more information on setting up a bot see my article Facebook Bots for Fun and Profit
The example bot is DMS Software Bot
The source code is Github fb-robot
I've created a telegram bot and set a webhook as described in the docs. For testing purposes I've set it up so once you send the bot a message it replies back with the same message.
Now the issue I am having is that the updates from telegram are coming back really slowly and there are some messages I haven't received yet. Am I missing something or is the webhook method just really slow?
I had the same problem. Turns out I wasn't responding the telegram server after I got the POST request. Due to this, the server wasn't sure if I got the previous updates and was constantly sending my webhook past updates.
I have an express server and I added this bit of line after handling the POST Request.
res.sendStatus(403)
You can also confirm this by going to this url
https://api.telegram.org/<token>/getWebhookInfo
You'll see a property called pending_update_count. It should zero or close to it.