get server version

This commit is contained in:
array-in-a-matrix 2023-12-13 20:50:56 -05:00
parent a93284c3f5
commit 67955e0e2c
3 changed files with 9 additions and 2 deletions

View file

@ -5,7 +5,9 @@ import nimbotsdk/MatrixAuth
export newMatrixAuth, passwordLogin, accessToken
import nimbotsdk/MatrixClient
export newMatrixClient, start, onRoomMessage
export newMatrixClient
export getServerVersions
export start, onRoomMessage
export sendReadReceipt, setTyping, replyText, replyHtmlText, replyNotice, replyHtmlNotice, sendNotice, sendHtmlNotice, sendText, sendHtmlText, sendMessage, sendEvent, sendRawEvent, sendStateEvent, redactEvent, addPreprocessor
import nimbotsdk/AutojoinRoomsMixin

View file

@ -6,6 +6,9 @@ proc newMatrixClient*(homeserver, token: cstring): Client {.importjs: "new Matri
proc newMatrixClient*(homeserver, token: cstring, storage: Storage): Client {.importjs: "new MatrixClient(#, #, #)".}
proc newMatrixClient*(homeserver, token: cstring, storage: Storage, cryptoStore: CryptoStore): Client {.importjs: "new MatrixClient(#, #, #, #)".}
proc getServerVersions*(client: Client): ServerVersions {.importjs: "#.getServerVersions()".}
# TODO: returns promise that is needed
proc start*(client: Client, filter: Filter = nil) {.importjs: "#.start(#)".} #? returns a promise
proc onRoomMessage*(client: Client, callback: proc(roomId: cstring, event: Event)) {.importjs: "#.on('room.message', #)".}

View file

@ -28,4 +28,6 @@ type Filter* = ref object
type Appservice* = ref object
type IPreprocessor* = ref object
type IPreprocessor* = ref object
type ServerVersions* = ref object