Implement delay timing

This commit is contained in:
2026-02-17 21:49:33 +00:00
parent dc28745fc3
commit eedad846ef
6 changed files with 310 additions and 34 deletions

View File

@@ -48,7 +48,9 @@ async def download_and_encode_base64(file_url, filename, content_type, session=N
return None
file_data = await response.read()
base64_encoded = base64.b64encode(file_data).decode("utf-8")
return f"data:{content_type};filename={filename};base64,{base64_encoded}"
return (
f"data:{content_type};filename={filename};base64,{base64_encoded}"
)
async with aiohttp.ClientSession() as local_session:
async with local_session.get(file_url, timeout=10) as response:
@@ -104,7 +106,9 @@ async def send_message_raw(recipient_uuid, text=None, attachments=None):
file_url = row.get("url")
if not file_url:
return None
return await download_and_encode_base64(file_url, filename, content_type, session)
return await download_and_encode_base64(
file_url, filename, content_type, session
)
# Asynchronously resolve and encode all attachments
attachments = attachments or []