Skip to content

Commit

Permalink
remove: python-telegram-bot
Browse files Browse the repository at this point in the history
  • Loading branch information
z0z0r4 committed Jan 1, 2025
1 parent 0e72e28 commit 3f74534
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ redis==5.0.1
httpx~=0.27.2
loguru==0.7.2
tenacity==8.3.0
apscheduler==3.10.4
python-telegram-bot==21.6
apscheduler==3.10.4
27 changes: 0 additions & 27 deletions utils/telegram/__init__.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,16 @@
from typing import List, Dict, Union, Sequence
from pydantic import BaseModel
# import telegram
import tenacity
from datetime import datetime
# from telegram.error import TelegramError
# from httpx._exceptions import NetworkError
from abc import ABC, abstractmethod

from utils.network import request_sync
from utils import SyncMode
from config import Config
from utils.loger import log

# bot: telegram.Bot
config = Config.load()


# def init_bot():
# global bot
# bot = telegram.Bot(
# token=config.bot_token,
# base_url=config.bot_api,
# request=telegram.request.HTTPXRequest(
# proxy=config.telegram_proxy, connection_pool_size=64
# ),
# )
# return bot


# @tenacity.retry(
# # retry=tenacity.retry_if_exception_type(TelegramError, NetworkError), # 无条件重试
# wait=tenacity.wait_fixed(1),
# stop=tenacity.stop_after_attempt(10),
# )
# async def send_message(text: str):
# await bot.send_message(chat_id=config.chat_id, text=text)
# log.info(f"Message '{text}' sent to telegram.")


@tenacity.retry(
# retry=tenacity.retry_if_exception_type(TelegramError, NetworkError), # 无条件重试
wait=tenacity.wait_fixed(1),
Expand Down

0 comments on commit 3f74534

Please sign in to comment.