DiscordSRV / Download

A fast & flexible download, update check and security checking api
MIT License
2 stars 0 forks source link

DSRV Alerts-style functionality for new downloads (and maybe even other events) #3

Open GreemDev opened 1 year ago

GreemDev commented 1 year ago

From Discord:

I think it'd be pretty neat to have the ability to send an embed, with a configuration that I guess could be similar to alerts, when new versions are obtained by the server, with placeholders My idea is that I could have new downloads be posted to the discord with like a "build for commit 4535r43" and a download url for the specific version I guess it'd kinda be like another webhook in the same place where the webhook is already used

I'd also like to say, if this gets added I would also ask for a way to send a test message with placeholder useless info just to test the format, because I really wouldn't want to have to keep committing to a project to test the download embed

Vankka commented 1 year ago

Right now it just posts hard coded messages to the single webhook url set in the config for all channels, a few things that come to mind from this;

GreemDev commented 1 year ago

Instead of SpEL I'd use Starscript, which is at the very least an enhanced String.format.

This is because I can't really see a reason to use things outside of what is defined by whatever is configured in Starscript. In DSRV it makes sense, because there's literally thousands of other plugins people could want to interface with, but here it's just a downloader. Plus, Starscript is very easy to use as it's just "text {some.code().here}".

You can see how Starscript is used here.

In my fork of the project that links to, Meteor Client, I have some kotlin extensions that allow the functions to be declared more concisely than that of what Meteor does in Java, if you're willing to use some Kotlin.

If you're open to having some Kotlin I can PR in these things if you want.