Nim wrapper for the Matrix bot SDK.
Go to file
2024-01-14 23:16:39 -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
nimbotsdk wrapped all matrix client methods 2023-12-19 22:46:59 -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.nim Auth is just the Client class, accessToken is a method of Client 2023-12-14 18:48:14 -05:00
nimbotsdk.nimble nimble package file 2024-01-14 23:16:39 -05:00
package.json node deps 2023-12-03 17:47:05 -05:00
pnpm-lock.yaml node deps 2023-12-03 17:47:05 -05:00
README.md improved readme 2024-01-12 15:24:40 -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 compile and run code this way too. You can inspect the produced JavaScript this way:

nim js printToken.nim
node printToken.js