rich reply preprocessor

This commit is contained in:
array-in-a-matrix 2023-12-11 21:50:15 -05:00
parent cd0b2c62e7
commit a93284c3f5
4 changed files with 16 additions and 5 deletions

View file

@ -6,10 +6,13 @@ export newMatrixAuth, passwordLogin, accessToken
import nimbotsdk/MatrixClient
export newMatrixClient, start, onRoomMessage
export sendReadReceipt, setTyping, replyText, replyHtmlText, replyNotice, replyHtmlNotice, sendNotice, sendHtmlNotice, sendText, sendHtmlText, sendMessage, sendEvent, sendRawEvent, sendStateEvent, redactEvent
export sendReadReceipt, setTyping, replyText, replyHtmlText, replyNotice, replyHtmlNotice, sendNotice, sendHtmlNotice, sendText, sendHtmlText, sendMessage, sendEvent, sendRawEvent, sendStateEvent, redactEvent, addPreprocessor
import nimbotsdk/AutojoinRoomsMixin
export AutojoinRoomsMixinSetupOnClient, AutojoinRoomsMixinSetupOnAppservice
import nimbotsdk/SimpleFsStorageProvider
export newSimpleFsStorageProvider
export newSimpleFsStorageProvider
import nimbotsdk/RichRepliesPreprocessor
export newRichRepliesPreprocessor

View file

@ -43,4 +43,6 @@ proc sendRawEvent*(client: Client, roomId: cstring, eventType: cstring, content:
proc sendStateEvent*(client: Client, roomId: cstring, `type`: cstring, content: Event) {.importjs: "#.sendStateEvent(#, #, #, #)".}
proc redactEvent*(client: Client, roomId: cstring, eventId: cstring, reason: cstring = nil) {.importjs: "#.redactEvent(#, #, #)".}
proc redactEvent*(client: Client, roomId: cstring, eventId: cstring, reason: cstring = nil) {.importjs: "#.redactEvent(#, #, #)".}
proc addPreprocessor*(client: Client, preprocessor: IPreprocessor): void {.importjs: "#.addPreprocessor(#)".}

View file

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

View file

@ -26,4 +26,6 @@ type Event* = ref object
type Filter* = ref object
type Appservice* = ref object
type Appservice* = ref object
type IPreprocessor* = ref object