mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-11-19 00:56:29 +01:00
22 lines
653 B
Python
22 lines
653 B
Python
# messages/send_ping.py
|
|
from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream
|
|
from nostr_dvm.backends.mcp.messages.send_message import send_message
|
|
from nostr_dvm.backends.mcp.messages.message_types.ping_message import PingMessage
|
|
|
|
async def send_ping(
|
|
read_stream: MemoryObjectReceiveStream,
|
|
write_stream: MemoryObjectSendStream,
|
|
) -> bool:
|
|
# create a ping message
|
|
ping_msg = PingMessage()
|
|
|
|
# send the message
|
|
response = await send_message(
|
|
read_stream=read_stream,
|
|
write_stream=write_stream,
|
|
message=ping_msg
|
|
)
|
|
|
|
# return the response
|
|
return response is not None
|