nimbotsdk/examples/echo.nim
2023-12-08 21:21:29 -05:00

15 lines
No EOL
358 B
Nim

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", "<h1><em>pong!</em></h1>")
)