freshcoders / discorki

MIT License
1 stars 0 forks source link

Restructure notification logic #79

Closed ikdekker closed 1 year ago

ikdekker commented 1 year ago

Making all these separate notifications is not the most efficient. Many of them loop through summoners, with simple checks being done.

To me it would make sense to accumulate data, or create a different structure for adding embeds.

Now we do:

  1. loop notification
  2. loop summoners
  3. check conditions
  4. add build embed..

And since almost all embed context is the same (summoner, queuename...) we can add this in one template as well. So it'd be something like:

  1. loop some notification type (e.g. summoners)
  2. check condition of all attached/subscribed notifications
  3. add build embed

We could then remove the need for creating a class for each new notification (if it is one of the "trivial" existing types).

So, instead of "registering" the team notification checkers: https://github.com/freshcoders/discorki/blob/87656c209df6e9ec3668f5299cc70c51f3d78efd/src/main/java/com/alistats/discorki/tasks/CheckMatchFinishedTask.java#L31 We would just run some wrapper loops.

ikdekker commented 1 year ago

Ill update on this later, to see if it actually makes sense to make the effort