Fixed scenario where it could log that a message was sent by the bot when it in fact failed to send.
Reason:
The sending operation was logged after the message was validated, but before the bot actually tried to connect to the Telegram API to send the message. It was observed first hand that in fringe cases, the bot could lose connection to the API between the validation and sending steps, causing the log to show that the message was sent, although it was not.
Fix:
The log entry is now done in two parts. "Sending ...." is printed after validation, and a colorized "OK" is appended once the operation is complete.
Fixed scenario where it could log that a message was sent by the bot when it in fact failed to send.
Reason:
The sending operation was logged after the message was validated, but before the bot actually tried to connect to the Telegram API to send the message. It was observed first hand that in fringe cases, the bot could lose connection to the API between the validation and sending steps, causing the log to show that the message was sent, although it was not.
Fix:
The log entry is now done in two parts. "Sending ...." is printed after validation, and a colorized "OK" is appended once the operation is complete.
Fixed scenario where it could log that a message was sent by the bot when it in fact failed to send.
Reason:
The sending operation was logged after the message was validated, but before the bot actually tried to connect to the Telegram API to send the message. It was observed first hand that in fringe cases, the bot could lose connection to the API between the validation and sending steps, causing the log to show that the message was sent, although it was not.
Fix:
The log entry is now done in two parts. "Sending ...." is printed after validation, and a colorized "OK" is appended once the operation is complete.
08f0a1fcf8
.