refactor: centralize settings and application services
This commit is contained in:
@@ -6,7 +6,7 @@ from zoneinfo import ZoneInfo
|
||||
from telegram.ext import Application
|
||||
|
||||
from .config import REMINDER_POLL_SECONDS
|
||||
from .storage import AssistantStorage
|
||||
from .services import SERVICES_KEY, ApplicationServices
|
||||
from .telegram_utils import escape_markdown_text, markdown_code, send_markdown
|
||||
from .time_utils import format_local_dt, utc_now
|
||||
|
||||
@@ -15,8 +15,9 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
async def reminder_loop(application: Application) -> None:
|
||||
storage: AssistantStorage = application.bot_data["storage"]
|
||||
tz: ZoneInfo = application.bot_data["timezone"]
|
||||
services: ApplicationServices = application.bot_data[SERVICES_KEY]
|
||||
storage = services.storage
|
||||
tz: ZoneInfo = services.timezone
|
||||
|
||||
while True:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user