.vscode | ||
examples | ||
nimbotsdk | ||
.gitignore | ||
LICENSE | ||
nimbotsdk.nim | ||
package.json | ||
pnpm-lock.yaml | ||
README.md |
Nim Bot SDK
Nim wrapper for the Matrix bot SDK.
Setup
Make sure you have Nim and Node.js installed before starting your own project or to contribute.
The library needs the Matrix Bot SDK JavaScript module:
pnpm add matrix-bot-sdk
Development
Nim files inside nimbotsdk/
are named after the file they wrap (MatrixAuth.nim
is a wrapper to MatrixAuth.d.ts
). matrixTypes.nim
defines the object types used throughout the entire library.
Procedures that have been tested to work are imported into nimbotsdk.nim
in the root of the project.
Usage
To use the library in your Nim program, import nimbotsdk.nim
from the root of the repository. To import a specific module without importing the whole library, you can import matrixTypes.nim
and the needed module(s) from nimbotsdk/
.
There are code examples inside the examples/
directory.
Make sure the homeserver URL and token (or username and password) are valid then you can compile and run code:
nim js -r printToken.nim
You can inspect the produced JavaScript this way if you want:
nim js printToken.nim
node printToken.js