pass linter and pytest

This commit is contained in:
MuXinCG
2026-02-15 20:57:21 +08:00
parent 358f63994b
commit 91e0cfb7c1
3 changed files with 59 additions and 17 deletions
+3 -5
View File
@@ -1,8 +1,6 @@
"""Telegram channel implementation using python-telegram-bot."""
import asyncio
import logging
import re
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
@@ -37,6 +35,9 @@ class TelegramChannel(Channel):
self._bot_username: str = ""
async def start(self) -> None:
if not self.config.bot_token:
raise ChannelError("Telegram bot token is required")
try:
from telegram.ext import (
ApplicationBuilder,
@@ -49,9 +50,6 @@ class TelegramChannel(Channel):
"Install with: pip install evoscientist[telegram]"
)
if not self.config.bot_token:
raise ChannelError("Telegram bot token is required")
builder = ApplicationBuilder().token(self.config.bot_token)
if self.config.proxy:
builder = builder.proxy(self.config.proxy).get_updates_proxy(self.config.proxy)