Compare commits

...

4 Commits

Author SHA1 Message Date
array-in-a-matrix 2306cdf55d fix typo 2024-03-26 13:42:03 -04:00
array-in-a-matrix 04fb995f6e file structure changes 2024-03-26 13:41:44 -04:00
array-in-a-matrix 5f41c6bc08 updated path 2024-03-26 13:14:56 -04:00
array-in-a-matrix c3829a60df match directory structure of og lib 2024-03-26 13:13:30 -04:00
7 changed files with 18 additions and 24 deletions

View File

@ -1,10 +1,11 @@
import ../src/nimbotsdk/[matrixTypes, MatrixClient, AutojoinRoomsMixin, SimpleFsStorageProvider, RustSdkCryptoStorageProvider]
import ../src/nimbotsdk/[matrixTypes, MatrixClient, mixins/AutojoinRoomsMixin]
import ../src/nimbotsdk/storage/[SimpleFsStorageProvider, RustSdkCryptoStorageProvider]
const
homeserver: cstring = "https://matrix.example.xyz"
token: cstring = "token"
let storage = newSimpleFsStorageProvider("storeage.json")
let storage = newSimpleFsStorageProvider("storage.json")
let cryptoStorage = newRustSdkCryptoStorageProvider("./cryptoStorage/")
let client = newMatrixClient(homeserver, token, storage, cryptoStorage)

View File

@ -1,7 +1,7 @@
# 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
import ../src/nimbotsdk
import jsconsole
const homeserverUrl: cstring = "https://matrix.example.xyz"

View File

@ -1,28 +1,21 @@
# Things here have been tested to work
import nimbotsdk/matrixTypes
export ICryptoStorageProvider, Storage, Client, Content, Unsigned, Event, Filter, Appservice
export ICryptoStorageProvider, Storage, Client, Content, Unsigned, Event,
Filter, Appservice
import nimbotsdk/MatrixAuth
export newMatrixAuth, passwordLogin
import nimbotsdk/MatrixClient
export newMatrixClient
export onRoomMessage
export newMatrixClient, onRoomMessage, addPreprocessor, getServerVersions,
start, sendReadReceipt, setTyping, replyText, replyHtmlText, replyNotice,
replyHtmlNotice, sendNotice, sendHtmlNotice, sendText, sendHtmlText,
sendMessage, sendEvent, sendRawEvent, sendStateEvent, redactEvent
export addPreprocessor, getServerVersions, start, sendReadReceipt, setTyping,
replyText, replyHtmlText, replyNotice, replyHtmlNotice, sendNotice,
sendHtmlNotice, sendText, sendHtmlText, sendMessage, sendEvent,
sendRawEvent, sendStateEvent, redactEvent
import nimbotsdk/AutojoinRoomsMixin
import nimbotsdk/mixins/AutojoinRoomsMixin
export AutojoinRoomsMixinSetupOnClient, AutojoinRoomsMixinSetupOnAppservice
import nimbotsdk/SimpleFsStorageProvider
export newSimpleFsStorageProvider
import nimbotsdk/RichRepliesPreprocessor
import nimbotsdk/preprocessors/RichRepliesPreprocessor
export newRichRepliesPreprocessor
import nimbotsdk/RustSdkCryptoStorageProvider
export RustSdkCryptoStorageProvider
import nimbotsdk/storage/[SimpleFsStorageProvider, RustSdkCryptoStorageProvider]
export newSimpleFsStorageProvider, RustSdkCryptoStorageProvider

View File

@ -1,6 +1,6 @@
{.emit:"/*INCLUDESECTION*/ import { AutojoinRoomsMixin } from 'matrix-bot-sdk';".}
import matrixTypes
import ../matrixTypes
proc AutojoinRoomsMixinSetupOnClient*(client: Client): void {.importjs: "AutojoinRoomsMixin.setupOnClient(#)".}

View File

@ -1,6 +1,6 @@
{.emit:"/*INCLUDESECTION*/ import { RichRepliesPreprocessor } from 'matrix-bot-sdk';".}
import matrixTypes
import ../matrixTypes
proc newRichRepliesPreprocessor*(): IPreprocessor {.importjs: "new RichRepliesPreprocessor()".}
proc newRichRepliesPreprocessor*(fetchRealEventContents: bool): IPreprocessor {.importjs: "new RichRepliesPreprocessor(#)".}

View File

@ -1,6 +1,6 @@
{.emit:"/*INCLUDESECTION*/ import { RustSdkCryptoStorageProvider } from 'matrix-bot-sdk';".}
import matrixTypes
import ../matrixTypes
proc newRustSdkCryptoStorageProvider*(storagePath: cstring): ICryptoStorageProvider {.importjs: "new RustSdkCryptoStorageProvider(#)"}
proc newRustSdkCryptoStorageProvider*(storagePath: cstring, storageType: cstring): ICryptoStorageProvider {.importjs: "new RustSdkCryptoStorageProvider(#, #)"}

View File

@ -1,6 +1,6 @@
{.emit:"/*INCLUDESECTION*/ import { SimpleFsStorageProvider } from 'matrix-bot-sdk';".}
import matrixTypes
import ../matrixTypes
proc newSimpleFsStorageProvider*(filename: cstring): Storage {.importjs: "new SimpleFsStorageProvider(#)".}
proc newSimpleFsStorageProvider*(filename: cstring, trackTransactionsInMemory: bool): Storage {.importjs: "new SimpleFsStorageProvider(#, #)".}