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
|
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)
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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
|
|
@ -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(#)".}
|
||||||
|
|
|
@ -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(#)".}
|
|
@ -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(#, #)"}
|
|
@ -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(#, #)".}
|
Loading…
Reference in a new issue