I have a weird problem. I have an application (a bot) sending messages back to the user. The messages are generally (but may be not) equipped with a keyboard (reply_markup=ReplyKeboardMarkup) on which the user chooses the next option. The application is based on Ubuntu 14.04 > Tomcat 5 > Coldfusion 16 > Telegram bot API 4. Everything has been working as a breeze (and it still does!).
Since I want to upgrade my aged server, I have been struggling on many recipes of server (Ubuntu 18.04 LTS or 20.04 LTS), Coldfusion (16 , 18, as well as Lucee, Openbluedragon) . It seems that Telegram bot API 5 are on line, I cannot choose.
The problem is that SendMessage equipped with reply_markup result in a 500 error, wilst the same message without the keyboard is accepted and sent smoothly. The keyboard has been carved to the bone, such as :
mykeyboard='{"keyboard":[["A","B"]],"one_time_keyboard":"true"} '
I have tried GET or POST methods in HTTP. I could understand some difference in migration from API 4 to API 5, but the very same API 5 keeps working with my application on the production server... headache. Can anybody show me a way to understand? Thank you
After the long puzzle, here's the answer. It seems that in API 5, in the definition of a keyboard, the
"one_time_keyboard"
clause is no longer supported. Just tease it away:
mykeyboard='{"keyboard":[["A","B"]]} '
and it will run again
:-(
Related
As per documentation from Apple (at WWDC session "Advances in App Background Execution"), "Repeatedly failing to report calls may prevent your app from receiving any more incoming call notifications." so in this case ,
1) How can we find out wether my app stop receiving any more incoming call notifications? is this data will present anywhere in console?
2) How can we do that work again?
One of my application stop receiving the voip notification from last week. Now i have updated my code base as per the documentation but still i am not getting any Voip notification.
You can follow this , we also had the same problem. The solution is here https://developer.apple.com/documentation/pushkit/responding_to_voip_notifications_from_pushkit
I'm working on a facebook chat bot, and I'm developing it using the serverless framework (Node.js) and deploying it to aws lambda. For the first few weeks, I just ran a local serverless lambda simulator using the serverless offline plugin and everything was working great. Yesterday, I finally decided to deploy it to AWS lambda, and now I see a significant drop in performance and consistency. Sometimes the bot takes 10 seconds to respond and sometimes it is instantaneous. The weird part is, on the lambda cloud logs, it always says the function completes in around 150 ms, which seems super fast, but the facebook bot simply doesn't mirror that speed. I am hitting a database, but the queries are definitely not taking anywhere near 10 seconds to run.
UPDATE:
I decided to try to test the bot my manually sending requests to the API endpoint using postman (which is basically curl). Every time the api responded instantly, even when I send the exact same request body that the messenger does. So it seems like the request is just taking a long time to reach the lambda api, but when it gets there it runs as it should. Any ideas of how to fix this?
If the API is responding quickly to your curl request, then the problem isn't on AWS end. Try matching when you send your request via Facebook to your app and when your app recieves it.
If it's getting held up on Facebooks end, Im afraid there isnt much you can do to solve it.
Another issue could be the datacenter your lambda is running in versus where facebook is. For example, using chkutil.com, you can see facebook.com seems particularly slow from the Asia-Pacific datacenters.
As it turns out, Facebook was experiencing DNS issues and has since remedied the issue.
I am trying to create an hip chat bot with nodejs. The main library is node-xmpp. However at the moment the build is failing and I think thats why my nom install doesn't work.
Any who I managed to write my own version based on the core modules.
- node-xmpp-client
- node-xmpp-component
- node-xmpp-jid
I can see messages fine and send. But only private! although I am registered in a room I cannot see room messages.
The source code of node-xmpp says thats a message or stanza should have a type and from that understand if the message is private or not. Well to me only private messages come. I wonder if its an issue with Hipchat.
If you want to take a look at the code, I made a github repo as it would an overkill to page here. github
The 'problem' lies with the xmpp protocol itself.
Due to the way the protocol works, you need to have joined the room before you can receive messages from it.
Why I was, lead to believe otherwise, was because hip chat showed the user as online on the room, but in reality he is not online on the group he is just online.
this is my first post here so I hope I do well.
So, for a school project I'm handling our game's networking and we have chosen to create a multiplayer fighting game where users are able to use their phones as controllers. Originally, we were going to use phone mobile browsers and so I had some crazy Websocket server, TCP server combination going on.
Since then, we have decided to use a Unity app on the phone instead which has removed the need for the Websocket server. Before I explain the steps, these are two Github gists of the relevant code snippets that you can open in other tabs in order for this to be a bit easier to follow:
NodeJS TCP Server: https://gist.github.com/JesseLeitch/dce3f51eea893ea5872c
Unity TCP Client: https://gist.github.com/JesseLeitch/59212d34a6fad41a2efc
Now, my problem:
I will walk through the process here:
1) I start up my NodeJS TCP server on my laptop.
2) I start up a Unity game, receiving a message from the server that it has connected.
3) My team mate starts up a Unity "game"(it's our controller) on his laptop that connects to the server with a successful connection message once again from the server.
4) My friend presses a button on the controller.
5) The button sends a message to the server. For example, "Jump".
6) Here is where my problem arises. What should happen is the server then sends the message down to the game, the message is processed within the OpenStream function and then it is passed off to a movement script. This is not happening. Nothing is being read in the game and I do not know why.
I know that the writing function is working fine because the console.log on line 14 is outputting properly with his command. What I am unsure of is why the c.write(d) is not seemingly working properly - especially because this worked previously when I was using our previous Game <-> TCP <-> WS <-> Mobile browser set-up.
Any help people can offer is greatly appreciated as I'm stumped and I haven't seemed to find anything relevant in my searching because the server seems to communicate fine except for this issue.
Thanks!
~Camel
I'm developing a multiplayer game in NodeJS with NowJS, the thing is when more than 5
clients are connected it starts to take more time:
First I thought I was doing bad processing on server side,
so I put a console.log first line on the everyone.[event] and the
weird thing it is taking time to call it, after that everything goes
in a second.
I have downloaded the quick 10 lines chat room example here and opened 6 mozilla tabs and it happends the same, it takes time to fire the now event, not to
distribute the message or process on server-side ... any thoughts?
Thanks!
The problem was the version of NowJS & Node.js, please if you get this kind of error, try to update both to latest and put focus on what has been updated on the NowJS page.