generated from array-in-a-matrix/matrix-bot-template
basic lib start
This commit is contained in:
parent
7f6ceb1d32
commit
accc0dfa84
2 changed files with 13 additions and 1 deletions
|
@ -1 +0,0 @@
|
|||
import std/[jsconsole, asyncjs]
|
13
src/nimbotsdk.nim
Normal file
13
src/nimbotsdk.nim
Normal file
|
@ -0,0 +1,13 @@
|
|||
import std/[asyncjs]
|
||||
{.emit:"import { MatrixAuth } from 'matrix-bot-sdk';".}
|
||||
|
||||
type auth = ref object
|
||||
homeserverUrl: cstring
|
||||
|
||||
type Client = ref object
|
||||
accessToken: cstring
|
||||
|
||||
proc newMatrixAuth*(homeserver: cstring): auth {.importjs: "new MatrixAuth(#)".}
|
||||
|
||||
proc passwordLogin*(auth: auth, username, password: cstring): Client {.importjs: "await #.passwordLogin(#, #)".}
|
||||
proc accessToken*(client: Client): cstring {.importjs: "#.accessToken".}
|
Loading…
Add table
Reference in a new issue