Skip to content

Commit 2cd53d6

Browse files
committed
Fix BotEcho
1 parent bbedd9a commit 2cd53d6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/bot_echo.nim

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ import ./tui/persistence # Temporary Workaround for PeerDiscovery
1111
proc main() {.async.} =
1212

1313
let cfg = await getCfg("EchoBot")
14-
# let dsConfig = DefaultConfig()
15-
# let ident = createIdentity("EchoBot")
14+
let dsConfig = DefaultConfig()
15+
let ident = createIdentity("EchoBot")
1616
var chatClient = newClient(dsConfig, ident)
1717

18-
chatClient.onNewMessage(proc(convo: Conversation, msg: ContentFrame) {.async.} =
18+
chatClient.onNewMessage(proc(convo: Conversation, msg: ReceivedMessage) {.async.} =
1919
info "New Message: ", convoId = convo.id(), msg= msg
20-
await convo.sendMessage(chatClient.ds, msg)
20+
discard await convo.sendMessage(chatClient.ds, msg.content)
2121
)
2222

2323
chatClient.onNewConversation(proc(convo: Conversation) {.async.} =
2424
info "New Conversation Initiated: ", convoId = convo.id()
25-
await convo.sendMessage(chatClient.ds, initTextFrame("Hello!").toContentFrame())
25+
discard await convo.sendMessage(chatClient.ds, initTextFrame("Hello!").toContentFrame())
2626
)
2727

2828
await chatClient.start()

0 commit comments

Comments
 (0)