MCPcopy Create free account
hub / github.com/AstrBotDevs/AstrBot / to_bytes

Method to_bytes

astrbot/core/utils/media_utils.py:122–127  ·  view source on GitHub ↗

Decode the base64 payload, accepting missing padding.

(self)

Source from the content-addressed store, hash-verified

120 format: str | None = None
121
122 def to_bytes(self) -> bytes:
123 """Decode the base64 payload, accepting missing padding."""
124 return _decode_base64_payload(
125 self.base64_data,
126 error_message="invalid resolved media base64 data",
127 )
128
129 def to_data_url(self) -> str:
130 """Return a ``data:<mime>;base64,...`` URL for multimodal providers."""

Callers

nothing calls this directly

Calls 1

_decode_base64_payloadFunction · 0.85

Tested by

no test coverage detected