Open kapilace6 opened 1 year ago
We should also see how to maintain a channel ID mapping in our database so each module does not have to pass the discord channel ID manually and should pass a reference of that channel ID
Also if any notification is estimitated to have high volumes of calls to discord for sending message or running any events, ratelimits have to be taken into consideration as discord will have dynamic rate limit values for each API which is returned in a response header as X-RateLimit-Limit: 5
Refer: Discord Rate Limits
Why is there a need for channel ID mapping? Can you provide any cons to the channel IDs being saved and retrieved from a model directly?
As for rate limits, the HTTP client we are using will take care of 429 and 5xx responses from discord, through retries. We should log every one of these errors, such that we can analyze any bottlenecks in the future.
Apart from the ActivityLog class, which logs every action (non-GET) to the DB, we would also like to send notifications of certain events to a corresponding Discord channel.
Each event would have a message format(template), a discord channel, args to fill the message. The interface (if being built) should support an option to DM a particular user on Discord.
There may be an extension of the Notification Factory to calendar / email notifications in the future. Ensure that the interface is appropriately modeled to account for other channels.
Reference: https://dev.to/akhilarjun/factory-pattern-java-design-patterns-5h33