mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-06-26 11:29:28 +00:00
10 lines
397 B
Nim
10 lines
397 B
Nim
|
|
proc messaging_send*(
|
||
|
|
self: LogosDelivery, contentTopic: string, payload: seq[byte], ephemeral: bool
|
||
|
|
): Future[Result[string, string]] {.ffi.} =
|
||
|
|
let envelope = MessageEnvelope.init(
|
||
|
|
contentTopic = ContentTopic(contentTopic), payload = payload, ephemeral = ephemeral
|
||
|
|
)
|
||
|
|
let requestId = (await self.messagingClient.send(envelope)).valueOr:
|
||
|
|
return err(error)
|
||
|
|
return ok($requestId)
|