Add image/audio/file/location bridging. Fixes #9

This commit is contained in:
Tulir Asokan
2017-11-25 23:57:11 +02:00
parent 1caba73147
commit adeb271c1b
5 changed files with 151 additions and 32 deletions
+13 -5
View File
@@ -138,12 +138,20 @@ class TelegramUser {
return this.intent.sendText(roomID, text)
}
sendImage(roomID, opts) {
sendFile(roomID, file) {
return this.intent.sendMessage(roomID, {
msgtype: "m.image",
url: opts.content_uri,
body: opts.name,
info: opts.info,
msgtype: file.matrixtype || "m.file",
url: file.content_uri,
body: file.name || "Uploaded file",
info: file.info,
})
}
sendLocation(roomID, { long = 0.0, lat = 0.0, body = "Location" } = {}) {
return this.intent.sendMessage(roomID, {
msgtype: "m.location",
geo_uri: `geo:${lat},${long}`,
body,
})
}