generated from array-in-a-matrix/matrix-bot-template
client auto join room works+move types to own file
This commit is contained in:
parent
71c16abd71
commit
1e77807867
|
@ -1,7 +1,12 @@
|
|||
import src/matrixTypes
|
||||
export ICryptoStorageProvider, Storage, CryptoStore, Auth, Client, Content, Unsigned, Event, Filter, Appservice
|
||||
|
||||
import src/MatrixAuth
|
||||
export newMatrixAuth, passwordLogin, accessToken
|
||||
|
||||
import src/MatrixClient
|
||||
export Client, Content, Unsigned, Event, Filter
|
||||
export newMatrixClient, start, onRoomMessage
|
||||
export sendReadReceipt, setTyping, replyText, replyHtmlText, replyNotice, replyHtmlNotice, sendNotice, sendHtmlNotice, sendText, sendHtmlText, sendMessage, sendEvent, sendRawEvent, sendStateEvent, redactEvent
|
||||
export sendReadReceipt, setTyping, replyText, replyHtmlText, replyNotice, replyHtmlNotice, sendNotice, sendHtmlNotice, sendText, sendHtmlText, sendMessage, sendEvent, sendRawEvent, sendStateEvent, redactEvent
|
||||
|
||||
import src/AutojoinRoomsMixin
|
||||
export AutojoinRoomsMixinSetupOnClient, AutojoinRoomsMixinSetupOnAppservice
|
|
@ -1 +1,9 @@
|
|||
{.emit:"import { AutojoinRoomsMixin } from 'matrix-bot-sdk';".}
|
||||
{.emit:"import { AutojoinRoomsMixin } from 'matrix-bot-sdk';".}
|
||||
|
||||
import matrixTypes
|
||||
|
||||
proc AutojoinRoomsMixinSetupOnClient*(client: Client): void {.importjs: "AutojoinRoomsMixin.setupOnClient(#)".}
|
||||
|
||||
#? idk what type conditional is suppose to be, lib says:
|
||||
#? conditional?: (inviteEvent: any) => boolean
|
||||
proc AutojoinRoomsMixinSetupOnAppservice*(appservice: Appservice, conditional: auto = nil ): void {.importjs: "AutojoinRoomsMixin.setupOnAppservice(#, #)".}
|
|
@ -1,16 +1,11 @@
|
|||
{.emit:"import { MatrixAuth } from 'matrix-bot-sdk';".}
|
||||
|
||||
type auth = ref object
|
||||
homeserverUrl: cstring
|
||||
import matrixTypes
|
||||
|
||||
type Client = ref object
|
||||
homeserverUrl*: cstring
|
||||
accessToken*: cstring
|
||||
proc newMatrixAuth*(homeserver: cstring): Auth {.importjs: "new MatrixAuth(#)".}
|
||||
|
||||
proc newMatrixAuth*(homeserver: cstring): auth {.importjs: "new MatrixAuth(#)".}
|
||||
|
||||
proc passwordLogin*(auth: auth, username, password: cstring): Client {.importjs: "await #.passwordLogin(#, #)".}
|
||||
proc passwordLogin*(auth: auth, username, password, deviceName: cstring): Client {.importjs: "await #.passwordLogin(#, #, #)".}
|
||||
proc passwordLogin*(auth: Auth, username, password: cstring): Client {.importjs: "await #.passwordLogin(#, #)".}
|
||||
proc passwordLogin*(auth: Auth, username, password, deviceName: cstring): Client {.importjs: "await #.passwordLogin(#, #, #)".}
|
||||
|
||||
proc passwordRegister*(localpart, password: cstring): Client {.importjs: "await #.passwordRegister(#, #)".}
|
||||
proc passwordRegister*(localpart, password, deviceName: cstring): Client {.importjs: "await #.passwordRegister(#, #, #)".}
|
||||
|
|
Loading…
Reference in a new issue