Reformat Telegram /commands to !commands

This commit is contained in:
Tulir Asokan
2017-12-02 13:54:49 +02:00
parent a1ec408b5b
commit 2bda80526c
2 changed files with 22 additions and 8 deletions
+5 -6
View File
@@ -251,12 +251,11 @@ class Portal {
await this.loadAccessHash(sender.telegramPuppet)
switch (evt.content.msgtype) {
case "m.text":
if (evt.content.format === "org.matrix.custom.html") {
const { message, entities } = formatter.matrixToTelegram(evt.content.formatted_body, this.app)
await sender.telegramPuppet.sendMessage(this.peer, message, entities)
} else {
await sender.telegramPuppet.sendMessage(this.peer, evt.content.body)
}
const { message, entities } = formatter.matrixToTelegram(
evt.content.formatted_body || evt.content.body,
evt.content.format === "org.matrix.custom.html",
this.app)
await sender.telegramPuppet.sendMessage(this.peer, message, entities)
break
case "m.video":
case "m.audio":