Nim wrapper for the Matrix bot SDK.
Go to file
2024-01-14 23:50:10 -05:00
.vscode vscode recommended extensions for workplace 2023-12-09 18:31:52 -05:00
examples only import needed modules 2023-12-09 16:02:09 -05:00
src move to src 2024-01-14 23:24:03 -05:00
tests nimble tests 2024-01-14 23:16:20 -05:00
.gitignore nimble tests 2024-01-14 23:16:20 -05:00
LICENSE Initial commit 2023-12-03 17:41:40 -05:00
nimbotsdk.nimble test 2024-01-14 23:50:10 -05:00
README.md Update README.md 2024-01-12 15:31:15 -05:00

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