pass linter and pytest
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user