generated from array-in-a-matrix/matrix-bot-template
basic login example
This commit is contained in:
parent
accc0dfa84
commit
d463371ff2
1 changed files with 11 additions and 0 deletions
11
examples/printToken.nim
Normal file
11
examples/printToken.nim
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# This is a nim equivalent to the Login example written on the matrix-bot-sdk's
|
||||||
|
# documentation website: https://turt2live.github.io/matrix-bot-sdk/tutorial-bot.html
|
||||||
|
|
||||||
|
import ../src/nimbotsdk
|
||||||
|
|
||||||
|
const homeserverUrl: cstring = "https://matrix.example.xyz"
|
||||||
|
|
||||||
|
let auth = newMatrixAuth(homeserverUrl)
|
||||||
|
let client = auth.passwordLogin("username", "password")
|
||||||
|
|
||||||
|
echo("Copy this access token to your bot's config: ", client.accessToken)
|
Loading…
Add table
Reference in a new issue