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
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.
such as https://poggit.pmmp.io/p/ChatBridge
Unfortunately its formatting is very weird on poggit please visit https://github.com/DiscordBot-PMMP/DiscordBot/blob/3.0.1/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 is completely independent of the Main thread and pocketmine so collisions between my composer dependencies and anything else is impossible.
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/reactphp/promise/tree/v2.9.0) 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...
isThread()
on ChannelUpdateEvent
(#98, @Laith98Dev)Major rewrite, please see CHANGELOG.md for more details.
TLDR:
Storage::setTimestamp
throws Invalid Argument Exception instead of crashing when timestamp is negative.getServers()
+ getUsers()
added.getServerBans()
deprecated in favour of getBansByServer() (matching other server mapped getters)logging.debug
field in config.Reply to review by :
You can leave one review per plugin release, and delete or update your review at any time