As you may have noticed recently, some bug is causing the TG bot to go down quite often.
Ever since this happened, I’ve been very busy trying to find the root cause of this. I feel I am close, but not there yet. The server can handle all requests very well, but when timing out, it fails to send the responses to the Telegram endpoint.
First of all, hours of downtime shouldn’t happen anymore. This was mostly due to me being AFK or asleep, and the bots never really crashed before. If the bot is timing out, it will auto-restart in 1-2 minutes. This allows me to find the bug in peace, since I’m unable to reproduce to bug manually, it has to happen to see if my changes (or not) to see if my changes had any effect.
Some changes have been made to improve the performance of the bot:
-
Short AI queries like “Hi Rick” will be ignored from now on.
-
Several rate limits have been implemented to prevent spamming contracts to the bot.
-
I allowed querying the bot using self-bots before, but I will start banning IDs that are consistently spamming the bot.
TIP: You can add a deep link to Rick using?start=0xcontract
from your bot for quick access.
Some of these changes might be reverted when the bug is found.
Solved!