Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions gateway/platforms/discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ async def send_voice(
audio_path: str,
caption: Optional[str] = None,
reply_to: Optional[str] = None,
metadata: Optional[Dict[str, Any]] = None,
) -> SendResult:
"""Send audio as a Discord file attachment."""
if not self._client:
Expand Down Expand Up @@ -289,6 +290,7 @@ async def send_image_file(
image_path: str,
caption: Optional[str] = None,
reply_to: Optional[str] = None,
metadata: Optional[Dict[str, Any]] = None,
) -> SendResult:
"""Send a local image file natively as a Discord file attachment."""
if not self._client:
Expand Down Expand Up @@ -326,6 +328,7 @@ async def send_image(
image_url: str,
caption: Optional[str] = None,
reply_to: Optional[str] = None,
metadata: Optional[Dict[str, Any]] = None,
) -> SendResult:
"""Send an image natively as a Discord file attachment."""
if not self._client:
Expand Down
9 changes: 9 additions & 0 deletions tests/gateway/test_discord_media_metadata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import inspect

from gateway.platforms.discord import DiscordAdapter


def test_discord_media_methods_accept_metadata_kwarg():
for method_name in ("send_voice", "send_image_file", "send_image"):
signature = inspect.signature(getattr(DiscordAdapter, method_name))
assert "metadata" in signature.parameters, method_name
Loading