I would suggest you to try out this repo code and check if you face the same issue.
https://github.com/JiteshGaikwad/SocketWebAppBot