By continuing to use this site, you agree to the Terms of Service of this website, including usage of cookies.
OK, Don't show this again
stopon your server, then start it again.
DiscordBot is a pocketmine plugin that provides an extensive API for plugin developers to interact with discord creating endless possibilities.
Please note that this plugin offers no standalone features, It is a central API plugin for external plugins to use/depend on.
Unfortunately its formatting is very weird on poggit please visit https://github.com/DiscordBot-PMMP/DiscordBot/blob/2.0.0/API.md for API documentation
This is a very complicated plugin when looked at but its essentially broken down into 4 parts.
The plugin interacts directly with the pocketmine server and sets up a child thread to start the connection to discord, its also the section responsible for handling API requests from other plugins and emitting events, providing data etc to other plugins.
This 'discord thread' is responsible for keeping a live connection to discords gateway so we can receive and pass on events back to the plugin base. We also execute API requests sent from the plugin base here and return a result in the near future when discord sends a response to our API request.
Technical note, the thread uses its own composer autoloader alongside pocketmines' thus making the chance of collisions close to 0% (plugin does check for conflicts before loading them)
This part is the biggest part of the plugin that works in the background inside the discord thread, It's a collection of third part libraries including DiscordPHP, React libraries, Monolog and much more.
Note you should NEVER be using or even looking at these libraries, they are not registered in the BaseClassLoader.
The 'face' of the plugin, using a shaded library (https://github.com/DiscordBot-PMMP/promise/tree/2.x) the plugin provides a 'promise' API which means plugins can make requests to do certain things like sendMessage or createRole and the plugin will send back a promise.
A promise is sent back because we can't return instantly whether it was a success or not because we have to send it to the Discord Thread which then sends it to discords gateway(/api for some api methods) and then we have to wait for a response then return the response to the plugin/main thread and THEN we can tell you if it was a success or not.
So you can essentially attach functions to the promise to run when we come back quite a few ticks later with a response.
Hard to explain, go read the API tab if your still interested...
Reply to review by :
You can leave one review per plugin release, and delete or update your review at any time
This Release will be permanently deleted and cannot be recovered. Are you sure?