update deprecated functions

This commit is contained in:
Jazz Turner-Baggs 2025-11-20 16:01:37 -08:00
parent ba124a3739
commit 27f748399f
No known key found for this signature in database
2 changed files with 8 additions and 8 deletions

View File

@ -38,7 +38,7 @@ proc main() {.async.} =
# Wire Callbacks
saro.onNewMessage(proc(convo: Conversation, msg: ReceivedMessage) {.async.} =
echo " Saro <------ :: " & getContent(msg.content)
await sleepAsync(5000)
await sleepAsync(5000.milliseconds)
discard await convo.sendMessage(saro.ds, initTextFrame("Ping").toContentFrame())
)
@ -52,11 +52,11 @@ proc main() {.async.} =
raya.onNewMessage(proc(convo: Conversation,msg: ReceivedMessage) {.async.} =
echo fmt" ------> Raya :: from:{msg.sender} " & getContent(msg.content)
await sleepAsync(500)
await sleepAsync(500.milliseconds)
discard await convo.sendMessage(raya.ds, initTextFrame("Pong" & $ri).toContentFrame())
await sleepAsync(800)
await sleepAsync(800.milliseconds)
discard await convo.sendMessage(raya.ds, initTextFrame("Pong" & $ri).toContentFrame())
await sleepAsync(500)
await sleepAsync(500.milliseconds)
discard await convo.sendMessage(raya.ds, initTextFrame("Pong" & $ri).toContentFrame())
inc ri
)
@ -73,13 +73,13 @@ proc main() {.async.} =
await saro.start()
await raya.start()
await sleepAsync(5000)
await sleepAsync(5.seconds)
# Perform OOB Introduction: Raya -> Saro
let raya_bundle = raya.createIntroBundle()
discard await saro.newPrivateConversation(raya_bundle)
await sleepAsync(20000) # Run for some time
await sleepAsync(20.seconds) # Run for some time
saro.stop()
raya.stop()

View File

@ -490,7 +490,7 @@ proc appLoop(app: ChatApp, panes: seq[Pane]) : Future[void] {.async.} =
illwillInit(fullscreen = false)
# Clear buffer
while true:
await sleepAsync(5)
await sleepAsync(5.milliseconds)
app.tb.clear()
drawStatusBar(app, panes[0], fgBlack, getIdColor(app.client.getId()))
@ -527,7 +527,7 @@ proc appLoop(app: ChatApp, panes: seq[Pane]) : Future[void] {.async.} =
proc peerWatch(app: ChatApp): Future[void] {.async.} =
while true:
await sleepAsync(1000)
await sleepAsync(1.seconds)
app.peerCount = app.client.ds.getConnectedPeerCount()