momentum-mod / website

Momentum Mod's main website.
https://momentum-mod.org
MIT License
55 stars 60 forks source link

Post to webhook when new map is fully published #607

Open Gocnak opened 2 years ago

Gocnak commented 2 years ago

When a new map is fully published (admin approved and clicked green check), we should post to (a) webhook(s) announcing such news. This will allow us to be flexible with our game's announcements on Discord.

hexaflexahexagon commented 2 years ago

idk if these are something that would just be available in our discord server or if people could use them in their own servers, but if they can then it could be cool to consider some sort of separate event for WIP maps being added/updated/something, making it easier for people to get slammed in the face in discord when something needs testing. not sure at all about the mechanics behind webhooks and how cumbersome that may be to add, as people will probably only actually want a few gamemodes or events to get posted in their discord channels. if people were able to select for example:

I want the following map notifications:

For the following gamemodes:

then that'd be sick

TheNerdMan commented 2 years ago

So just doing some quick research on Webhooks as while I've used them I haven't developed them. Looks like we'd basically need to collect a bunch of endpoint URL's that we'd want to post to when a map is complete/updated. And we would need to set it up in a way where those Webhooks are tied to a user account too.

Here is a super simple implementation using NestJS. https://www.fullstacklabs.co/blog/how-to-implement-webhooks-using-nestjs. Again we'd need to update our DB schema somewhere to include a webhooks table/column and draw up a whole UI/UX flow for giving us a webhook endpoint.

Here's a list of some of the things that bounce around my mind when thinking about this feature:

But I personally think that this should be handled by the bot to begin with. Then when we've given it more thought and have a bit more of an existing method of notifying users when maps change status, then this should be looked at being implemented.

Gocnak commented 2 years ago

If it's going to be in people's servers, it'll be a bot integration for sure. This issue was made with just the official discord in mind. We could even make the official channel we use an announcement channel that people can follow and put in their servers too.

TheNerdMan commented 2 years ago

Yeah my thought exactly, this feature does allow for more collaborative development (e.g. users would be able to make their own dumb downed MMod bot) but honestly I think this should be put as a super low priority and this should be handled by the discord bot first, then maybe this later down the line

hexaflexahexagon commented 2 years ago

sounds good to me. we use a webhook ONLY for what's outlined in the above issue ONLY for a channel in our discord server, then live posting of things like wrs/new maps/wip maps in everyone else's server goes to the new JS bot.

tsa96 commented 1 year ago

This is really complex, we'll discuss more soon

Gocnak commented 3 weeks ago

The backend will have an env var for the webhook to post to. It will be an announcement channel, and can ping a specific role that users can opt into in the server to get notified. Other servers can "follow" the channel to get it in their servers, this will not be in a Discord bot.