diff --git a/examples/echo.nim b/examples/echo.nim new file mode 100644 index 0000000..4f1e6a9 --- /dev/null +++ b/examples/echo.nim @@ -0,0 +1,15 @@ + +import ../nimbotsdk + +const + homeserver: cstring = "https://matrix.example.xyz" + token: cstring = "token" + +let client = newMatrixClient(homeserver, token) + +client.start() + +client.onRoomMessage(proc(roomId: cstring, event: Event) = + if(event.content.body == "ping"): + client.replyNotice(roomId, event, "pong", "