diff options
Diffstat (limited to 'src/dist/classes/DM.js')
-rw-r--r-- | src/dist/classes/DM.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dist/classes/DM.js b/src/dist/classes/DM.js index 59f7bfc..41b07c0 100644 --- a/src/dist/classes/DM.js +++ b/src/dist/classes/DM.js @@ -4,6 +4,7 @@ exports.DM = void 0; const Channel_1 = require("./Channel"); const CLIDispatcher_1 = require("./CLIDispatcher"); const SentDataMessage_1 = require("./SentDataMessage"); +const MessageFormatting_1 = require("./MessageFormatting"); /** * A Signal 1-to-1 chat */ @@ -30,6 +31,11 @@ class DM extends Channel_1.Channel { * @param options - The optional options used to build the message */ async send(text, options) { + let originalText = text; + if (options?.markdown) { + text = MessageFormatting_1.MessageFormatting.plainFromMarkdown(text); + options.formatting = MessageFormatting_1.MessageFormatting.fromMarkdown(originalText); + } let data = await CLIDispatcher_1.CLIDispatcher.dispatch("send", { recipient: [this.number], message: text, @@ -54,8 +60,7 @@ class DM extends Channel_1.Channel { */ async setTyping(typing) { await CLIDispatcher_1.CLIDispatcher.dispatch("sendTyping", { - recipient: [this.number], - stop: !typing + recipient: [this.number], stop: !typing }, this.client.process); } /** @@ -64,8 +69,7 @@ class DM extends Channel_1.Channel { */ async sendSticker(sticker) { await CLIDispatcher_1.CLIDispatcher.dispatch("send", { - recipient: [this.number], - sticker: sticker.pack.id + ":" + sticker.id + recipient: [this.number], sticker: sticker.pack.id + ":" + sticker.id }, this.client.process); } } |