nimbotsdk/examples/printToken.nim
array-in-a-matrix 4553eb046b revert 33761b8191
revert jsconsole creates cleaner executables
2023-12-08 20:41:20 -05:00

11 lines
No EOL
419 B
Nim

# 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 ../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)