Events are Discord Client member functions that can be overridden and are called when an event happens such as receiving a message. For example, the function onMessage is an event. Events are received on an ongoing connection with Discord's server. This has the advantage of not needing to keep sending a request for data, as such there's no worry for waiting for the response, dealing with rate limits, or possibility slowing down Discord.
To use, you first need to set the intents to tell Discord to send them before running as this happens at the beginning of the connection. Next, you override onMessage member function with what you want to happen when the event occurs. This is based on Discord API's gateway events. All events are declared in the header file client.h in the BaseDiscordClient class.
Currently the Library doesn't have a cache, but events are where you get your data for your cache. Make sure you listen to the
onDelete Events to keep your cache up to date.