generated from array-in-a-matrix/matrix-bot-template
16 lines
No EOL
398 B
Nim
16 lines
No EOL
398 B
Nim
import ../nimbotsdk
|
|
|
|
const
|
|
homeserver: cstring = "https://matrix.example.xyz"
|
|
token: cstring = "token"
|
|
|
|
let client = newMatrixClient(homeserver, token)
|
|
|
|
AutojoinRoomsMixinSetupOnClient(client)
|
|
|
|
client.start()
|
|
|
|
client.onRoomMessage(proc(roomId: cstring, event: Event) =
|
|
if(event.content.body == "ping"):
|
|
client.replyNotice(roomId, event, "pong", "<h1><em>pong!</em></h1>")
|
|
) |