MessengerDiscovery 2 API Overview
The MessengerDiscovery API is based around Main. When your plugin is initialized it is given a Main object which it must store. Your plugin must also register for events if it wishes to receive them.
The following image gives a visual representation of how things are structured in MessengerDiscovery 2: