add readme && update for stable

This commit is contained in:
2025-02-28 23:15:33 +03:00
parent 3392df2919
commit 2368b5df8c
7 changed files with 117 additions and 11 deletions
+22 -1
View File
@@ -1,13 +1,34 @@
import telebot
from config import config
import threading
import time
class BotCommands:
Start = ["start", "s"]
Help = ["help", "h"]
Help = ["help", "h", "помощь"]
Source = ["source"]
original_send_message = telebot.TeleBot.send_message
def send_message_with_try_catch(self, chat_id, text, *args, **kwargs):
try:
return original_send_message(self, chat_id, text, *args, **kwargs)
except Exception as e:
print(f"Error sending message: {e}. Retrying in 5 seconds...")
try:
time.sleep(5)
return original_send_message(self, chat_id, text, *args, **kwargs)
except Exception as e:
print(f"Second attempt failed: {e}")
telebot.TeleBot.send_message = send_message_with_try_catch
bot = telebot.TeleBot(
config.API_TOKEN,
colorful_logs=True,