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 const
homeserver: cstring = "https://matrix.example.xyz" homeserver: cstring = "https://matrix.example.xyz"
token: cstring = "token" token: cstring = "token"
let storage = newSimpleFsStorageProvider("storeage.json") let storage = newSimpleFsStorageProvider("storage.json")
let cryptoStorage = newRustSdkCryptoStorageProvider("./cryptoStorage/") let cryptoStorage = newRustSdkCryptoStorageProvider("./cryptoStorage/")
let client = newMatrixClient(homeserver, token, storage, 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 # 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 # documentation website: https://turt2live.github.io/matrix-bot-sdk/tutorial-bot.html
import ../nimbotsdk import ../src/nimbotsdk
import jsconsole import jsconsole
const homeserverUrl: cstring = "https://matrix.example.xyz" const homeserverUrl: cstring = "https://matrix.example.xyz"

View file

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

View file

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

View file

@ -1,6 +1,6 @@
{.emit:"/*INCLUDESECTION*/ import { RichRepliesPreprocessor } from 'matrix-bot-sdk';".} {.emit:"/*INCLUDESECTION*/ import { RichRepliesPreprocessor } from 'matrix-bot-sdk';".}
import matrixTypes import ../matrixTypes
proc newRichRepliesPreprocessor*(): IPreprocessor {.importjs: "new RichRepliesPreprocessor()".} proc newRichRepliesPreprocessor*(): IPreprocessor {.importjs: "new RichRepliesPreprocessor()".}
proc newRichRepliesPreprocessor*(fetchRealEventContents: bool): 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';".} {.emit:"/*INCLUDESECTION*/ import { RustSdkCryptoStorageProvider } from 'matrix-bot-sdk';".}
import matrixTypes import ../matrixTypes
proc newRustSdkCryptoStorageProvider*(storagePath: cstring): ICryptoStorageProvider {.importjs: "new RustSdkCryptoStorageProvider(#)"} proc newRustSdkCryptoStorageProvider*(storagePath: cstring): ICryptoStorageProvider {.importjs: "new RustSdkCryptoStorageProvider(#)"}
proc newRustSdkCryptoStorageProvider*(storagePath: cstring, storageType: 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';".} {.emit:"/*INCLUDESECTION*/ import { SimpleFsStorageProvider } from 'matrix-bot-sdk';".}
import matrixTypes import ../matrixTypes
proc newSimpleFsStorageProvider*(filename: cstring): Storage {.importjs: "new SimpleFsStorageProvider(#)".} proc newSimpleFsStorageProvider*(filename: cstring): Storage {.importjs: "new SimpleFsStorageProvider(#)".}
proc newSimpleFsStorageProvider*(filename: cstring, trackTransactionsInMemory: bool): Storage {.importjs: "new SimpleFsStorageProvider(#, #)".} proc newSimpleFsStorageProvider*(filename: cstring, trackTransactionsInMemory: bool): Storage {.importjs: "new SimpleFsStorageProvider(#, #)".}