en en en en en en en en en en en de en en en en en en en en de en en en en en en en en en en de en en en pt de de it en en en en en en en en en ko en en de en en en en de en de en de en de en en fr zh fr uk fr uk uk eo en en en en en en en en en en en en en en en en en en en en en en fr de en en en en en en en en en id en en en
Yasmin is a Discord API library for PHP. Yasmin connects to the Gateway and interacts with the REST API.
This library is only for PHP 7.1 (and later) and use in CLI. Only bot accounts are supported by Yasmin.
Before you start using this Library, you need to know how PHP works, you need to know the language and you need to know how Event Loops and Promises work. This is a fundamental requirement before you start. Without this knowledge, you will only suffer.
Getting started with Yasmin is pretty straight forward. All you need to do is to use composer to install Yasmin and its dependencies. After that, you can include composer's autoloader into your file and start interacting with Discord and Yasmin!
It is important to listen to error events. If you don't attach an error listener, the event emitter will throw an exception.
Make sure you also have a rejection handler for all promises, as unhandled promise rejections get swallowed and you will never know what happened to them.
Important Information: All properties on class instances, which are implemented using a magic method (which means pretty much all properties), are throwing if the property doesn't exist.
There is a WIP Gitbook with a few protips in it, feel free to read it: https://charlottedunois.gitbooks.io/yasmin-guide/content/
This is a fairly trivial example of using Yasmin. You should put all your listener code into try-catch blocks and handle exceptions accordingly.
There is no voice support.
Unfortunately PHP on Windows does not have access to the Windows Certificate Store. This is an issue because TLS gets used and as such certificate verification gets applied (turning this off is not an option).
You will notice this issue by your script exiting immediately after one loop turn without any errors. Unfortunately there is for some reason no error or exception.
As such users of this library need to download a Certificate Authority extract from the cURL website.