generated from array-in-a-matrix/matrix-bot-template
Compare commits
4 commits
bb5a1b19c2
...
2306cdf55d
Author | SHA1 | Date | |
---|---|---|---|
2306cdf55d | |||
04fb995f6e | |||
5f41c6bc08 | |||
c3829a60df |
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
|
@ -1,6 +1,6 @@
|
|||
{.emit:"/*INCLUDESECTION*/ import { AutojoinRoomsMixin } from 'matrix-bot-sdk';".}
|
||||
|
||||
import matrixTypes
|
||||
import ../matrixTypes
|
||||
|
||||
proc AutojoinRoomsMixinSetupOnClient*(client: Client): void {.importjs: "AutojoinRoomsMixin.setupOnClient(#)".}
|
||||
|
|
@ -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(#)".}
|
|
@ -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(#, #)"}
|
|
@ -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(#, #)".}
|
Loading…
Reference in a new issue