spacebarchat / server

Spacebar server - A reimplementation of the Discord.com backend, built with Typescript and love
https://spacebar.chat
GNU Affero General Public License v3.0
1.47k stars 252 forks source link

Refresh Discord Attachment URLs #1151

Open Puyodead1 opened 3 months ago

Puyodead1 commented 3 months ago

Is your feature request related to a problem? Please describe. Since Discord implemented signed attachment URLs, they now expire, sharing any of these links will break after some time.

Describe the solution you'd like The server could refresh these URLs by making a request to the Discord API, using a bot token (it works for some reason)

Describe alternatives you've considered One could re-upload the file to a different host or to the Spacebar instance, however this may not always be ideal.

Additional context Refreshing the links is as simple as a post request, which can be seen in this project: https://github.com/ShufflePerson/Discord_CDN/blob/master/src/Discord/Discord.ts

However, unlike this project, you do not need to use a user token, and thus would not be breaking the Discord ToS.

Kind of looking for feedback on this FR