fix: add **kwargs to base/telegram media send methods for metadata routing
The MEDIA routing in _process_message_background passes metadata=_thread_metadata to send_video, send_document, and send_image_file — but none accepted it, causing TypeError silently caught by the except handler. Files just failed to send. Fix: add **kwargs to all four base class media methods and their Telegram overrides.
This commit is contained in:
parent
322ffbed61
commit
69090d6da1
2 changed files with 7 additions and 0 deletions
|
|
@ -516,6 +516,7 @@ class BasePlatformAdapter(ABC):
|
||||||
audio_path: str,
|
audio_path: str,
|
||||||
caption: Optional[str] = None,
|
caption: Optional[str] = None,
|
||||||
reply_to: Optional[str] = None,
|
reply_to: Optional[str] = None,
|
||||||
|
**kwargs,
|
||||||
) -> SendResult:
|
) -> SendResult:
|
||||||
"""
|
"""
|
||||||
Send an audio file as a native voice message via the platform API.
|
Send an audio file as a native voice message via the platform API.
|
||||||
|
|
@ -535,6 +536,7 @@ class BasePlatformAdapter(ABC):
|
||||||
video_path: str,
|
video_path: str,
|
||||||
caption: Optional[str] = None,
|
caption: Optional[str] = None,
|
||||||
reply_to: Optional[str] = None,
|
reply_to: Optional[str] = None,
|
||||||
|
**kwargs,
|
||||||
) -> SendResult:
|
) -> SendResult:
|
||||||
"""
|
"""
|
||||||
Send a video natively via the platform API.
|
Send a video natively via the platform API.
|
||||||
|
|
@ -554,6 +556,7 @@ class BasePlatformAdapter(ABC):
|
||||||
caption: Optional[str] = None,
|
caption: Optional[str] = None,
|
||||||
file_name: Optional[str] = None,
|
file_name: Optional[str] = None,
|
||||||
reply_to: Optional[str] = None,
|
reply_to: Optional[str] = None,
|
||||||
|
**kwargs,
|
||||||
) -> SendResult:
|
) -> SendResult:
|
||||||
"""
|
"""
|
||||||
Send a document/file natively via the platform API.
|
Send a document/file natively via the platform API.
|
||||||
|
|
@ -572,6 +575,7 @@ class BasePlatformAdapter(ABC):
|
||||||
image_path: str,
|
image_path: str,
|
||||||
caption: Optional[str] = None,
|
caption: Optional[str] = None,
|
||||||
reply_to: Optional[str] = None,
|
reply_to: Optional[str] = None,
|
||||||
|
**kwargs,
|
||||||
) -> SendResult:
|
) -> SendResult:
|
||||||
"""
|
"""
|
||||||
Send a local image file natively via the platform API.
|
Send a local image file natively via the platform API.
|
||||||
|
|
|
||||||
|
|
@ -353,6 +353,7 @@ class TelegramAdapter(BasePlatformAdapter):
|
||||||
image_path: str,
|
image_path: str,
|
||||||
caption: Optional[str] = None,
|
caption: Optional[str] = None,
|
||||||
reply_to: Optional[str] = None,
|
reply_to: Optional[str] = None,
|
||||||
|
**kwargs,
|
||||||
) -> SendResult:
|
) -> SendResult:
|
||||||
"""Send a local image file natively as a Telegram photo."""
|
"""Send a local image file natively as a Telegram photo."""
|
||||||
if not self._bot:
|
if not self._bot:
|
||||||
|
|
@ -387,6 +388,7 @@ class TelegramAdapter(BasePlatformAdapter):
|
||||||
caption: Optional[str] = None,
|
caption: Optional[str] = None,
|
||||||
file_name: Optional[str] = None,
|
file_name: Optional[str] = None,
|
||||||
reply_to: Optional[str] = None,
|
reply_to: Optional[str] = None,
|
||||||
|
**kwargs,
|
||||||
) -> SendResult:
|
) -> SendResult:
|
||||||
"""Send a document/file natively as a Telegram file attachment."""
|
"""Send a document/file natively as a Telegram file attachment."""
|
||||||
if not self._bot:
|
if not self._bot:
|
||||||
|
|
@ -417,6 +419,7 @@ class TelegramAdapter(BasePlatformAdapter):
|
||||||
video_path: str,
|
video_path: str,
|
||||||
caption: Optional[str] = None,
|
caption: Optional[str] = None,
|
||||||
reply_to: Optional[str] = None,
|
reply_to: Optional[str] = None,
|
||||||
|
**kwargs,
|
||||||
) -> SendResult:
|
) -> SendResult:
|
||||||
"""Send a video natively as a Telegram video message."""
|
"""Send a video natively as a Telegram video message."""
|
||||||
if not self._bot:
|
if not self._bot:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue