fixed url detection

This commit is contained in:
murm 2023-03-17 00:18:14 -04:00
parent 304f147676
commit b2ecaf9997

View file

@ -136,7 +136,8 @@ const checkImages = async (message, extraReturnTypes, video, sticker) => {
const fileNameNoExtension = message.content.body.slice(0, message.content.body.lastIndexOf(".")); const fileNameNoExtension = message.content.body.slice(0, message.content.body.lastIndexOf("."));
type = {name: fileNameNoExtension, path: url, url: url, type: message.content.info.mimetype} type = {name: fileNameNoExtension, path: url, url: url, type: message.content.info.mimetype}
} }
} else if (message.content.msgtype == "m.text") { }
if (message.content.msgtype == "m.text") {
let url = message.content.body let url = message.content.body
url = url.replace(/.*\n\n/g, "") url = url.replace(/.*\n\n/g, "")
if (isValidUrl(url)){ if (isValidUrl(url)){