Skip to content

Commit

Permalink
fix: AttributeError: 'Logger' object has no attribute 'bind_context'
Browse files Browse the repository at this point in the history
  • Loading branch information
orenlab committed Jan 3, 2025
1 parent d0eccb2 commit f0397dc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pytmbot/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

class RateLimit:
def __init__(self, limit: int, period: int, ban_threshold: int = 50) -> None:
self.log = logger
self.log = logger.bind_context(
component="rate_limiter",
limit=limit,
Expand Down Expand Up @@ -96,6 +97,7 @@ class WebhookManager:
"""Manages webhook configuration and lifecycle."""

def __init__(self, bot: TeleBot, url: str, port: int, secret_token: str = None) -> None:
self.log = logger
self.log = logger.bind_context(
component="webhook_manager",
webhook_url=mask_token_in_message(url, bot.token),
Expand Down Expand Up @@ -190,6 +192,7 @@ class WebhookServer:
"""FastAPI server for handling Telegram webhook requests."""

def __init__(self, bot: TeleBot, token: str, host: str, port: int) -> None:
self.log = logger
self.log = logger.bind_context(
component="webhook_server",
host=host,
Expand Down

0 comments on commit f0397dc

Please sign in to comment.