generated from array-in-a-matrix/matrix-bot-template
added replyNotice, comments and smthn to ref objs
This commit is contained in:
parent
94fe7acffe
commit
bef5a6967a
1 changed files with 11 additions and 3 deletions
|
@ -14,9 +14,13 @@ type Client = ref object
|
|||
type Content = ref object
|
||||
body*, msgtype*: cstring
|
||||
|
||||
type Unsigned = ref object
|
||||
transaction_id*: cstring
|
||||
|
||||
type Event* = ref object
|
||||
content*: Content
|
||||
event_id*, sender*, `type`*: string
|
||||
unsigned*: Unsigned
|
||||
event_id*, sender*, `type`*, room_id*: string
|
||||
origin_server_ts*: int
|
||||
|
||||
|
||||
|
@ -24,7 +28,11 @@ 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 start*(client: Client) {.importjs: "#.start()".} # returns a promise tho
|
||||
# proc start*(client: Client, filter) {.importjs: "#.start(#)".}
|
||||
proc start*(client: Client) {.importjs: "#.start()".} #? returns a promise
|
||||
# TODO: proc start*(client: Client, filter) {.importjs: "#.start(#)".}
|
||||
|
||||
proc onRoomMessage*(client: Client, callback: proc(roomId: cstring, event: Event)) {.importjs: "#.on('room.message', #)".}
|
||||
# TODO: add more for each event name
|
||||
|
||||
proc replyNotice*(client: Client, roomId: cstring, event: Event, text: cstring) {.importjs: "#.replyNotice(#, #, #)".} #? returns a promise
|
||||
proc replyNotice*(client: Client, roomId: cstring, event: Event, text: cstring, html: cstring) {.importjs: "#.replyNotice(#, #, #, #)".} #? returns a promise
|
Loading…
Add table
Reference in a new issue