Repeat messages sent from Telegram

I’ve run into a problem where Telegram and Rasa repeatedly send the same message without input, and I’m not sure why. It is similar to a problem described with Slack here and FB messenger, but mine is a little different.

I’ve run into the problem with both Rasa X deployed on an AWS instance and Rasa open-source on my local machine. It seems to have happened when the bot encounters an error with a custom action (either because the action server isn’t running or if there’s some error in the code). The bot will send repeated responses, as though it’s trying to respond to the initial message sent from Telegram.

I’m not even sure how to debug this, because I’m not sure if it’s telegram sending multiple messages or Rasa.

Any help debugging or (ideally) fixing the problem would be great. Please let me know if you all need any info. Thanks