mirror of
https://gitdab.com/cadence/out-of-your-element.git
synced 2025-09-10 20:32:50 +02:00
Generate public urls for attachments in message
This commit is contained in:
parent
c6175e09f8
commit
adf07ad736
2 changed files with 9 additions and 1 deletions
|
@ -121,7 +121,7 @@ function timestampToSnowflakeInexact(timestamp) {
|
|||
|
||||
/** @param {string} url */
|
||||
function getPublicUrlForCdn(url) {
|
||||
const match = url.match(`https://cdn.discordapp.com/attachments/([0-9]+)/([0-9]+)/([-A-Za-z0-9_.,]+)`)
|
||||
const match = url.match(/https:\/\/cdn.discordapp.com\/attachments\/([0-9]+)\/([0-9]+)\/([-A-Za-z0-9_.,]+)/)
|
||||
if (!match) return url
|
||||
return `${reg.ooye.bridge_origin}/download/discordcdn/${match[1]}/${match[2]}/${match[3]}`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue