PHPackages                             valzargaming/yasmin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. valzargaming/yasmin

Abandoned → [team-reflex/discord-php](/?search=team-reflex%2Fdiscord-php)Library[API Development](/categories/api)

valzargaming/yasmin
===================

Yasmin is a Discord API library for PHP.

73705[2 issues](https://github.com/valzargaming/Nyasmin/issues)[1 PRs](https://github.com/valzargaming/Nyasmin/pulls)1PHP

Since Oct 15Pushed 5y ago3 watchersCompare

[ Source](https://github.com/valzargaming/Nyasmin)[ Packagist](https://packagist.org/packages/valzargaming/yasmin)[ RSS](/packages/valzargaming-yasmin/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (1)

**This fork is dedicated to maintaining the Yasmin core as used by Palace Bot#9203. The original codebase carchive/Yasmin was archived in December 2019 and later removed. This bot is confirmed to be working with PHP 7.3 and 7.4.3.**

Palace Bot Github:

Discord Server:

Yasmin
======

[](#yasmin)

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
================

[](#before-you-start)

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.

See  for resources.

Getting Started
===============

[](#getting-started)

Getting started with Yasmin is pretty straight forward. All you need to do is to use [composer](https://packagist.org/packages/valzargaming/yasmin) to install Yasmin and its dependencies. After that, you can include composer's autoloader into your file and start interacting with Discord and Yasmin!

```
composer require valzargaming/yasmin:"dev-master as 1.0.x-dev"

```

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:

Example
=======

[](#example)

This is a fairly trivial example of using Yasmin. You should put all your listener code into try-catch blocks and handle exceptions accordingly.

```
// Include composer autoloader

$loop = \React\EventLoop\Factory::create();
$client = new \CharlotteDunois\Yasmin\Client(array(), $loop);

$client->on('error', function ($error) {
    echo $error.PHP_EOL;
});

$client->on('ready', function () use ($client) {
    echo 'Logged in as '.$client->user->tag.' created on '.$client->user->createdAt->format('d.m.Y H:i:s').PHP_EOL;
});

$client->on('message', function ($message) {
    echo 'Received Message from '.$message->author->tag.' in '.($message->channel instanceof \CharlotteDunois\Yasmin\Interfaces\DMChannelInterface ? 'DM' : 'channel #'.$message->channel->name ).' with '.$message->attachments->count().' attachment(s) and '.\count($message->embeds).' embed(s)'.PHP_EOL;
});

$client->login('YOUR_TOKEN')->done();
$loop->run();
```

Voice Support
=============

[](#voice-support)

There is no voice support.

Windows and SSL
===============

[](#windows-and-ssl)

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](https://curl.haxx.se/docs/caextract.html) from the cURL website.
The path to the caextract must be set in the [`php.ini`](https://secure.php.net/manual/en/openssl.configuration.php) for `openssl.cafile`.

Linux Support
=============

[](#linux-support)

Use git to clone this repository.

Yasmin requires PHP 7.1+ to run, as well as the following packages. It's recommended to use the latest version of php available in your repository. In the example provided, 7.1 will be used. Replace 7.1 with the version you're currently using.

Ubuntu
------

[](#ubuntu)

```
sudo apt install openssl php7.1 php7.1-bcmath php7.1-mbstring

```

Notice of limited support
=========================

[](#notice-of-limited-support)

I cannot provide support with most issues that occur due to outdated prerequisites or implementing SSL. If you are hosting on Windows and needing a cacert.pem file but don't feel comfortable generating yourself then I personally recommend WinNMP as it generates one in its /data/ directory that you can point your PHP.ini at.

Other distros
-------------

[](#other-distros)

Please refer to your distros repository to find the packages above.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 96.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7202504?v=4)[Valithor Obsidion](/maintainers/valzargaming)[@valzargaming](https://github.com/valzargaming)

---

Top Contributors

[![valzargaming](https://avatars.githubusercontent.com/u/7202504?v=4)](https://github.com/valzargaming "valzargaming (370 commits)")[![AdamHebby](https://avatars.githubusercontent.com/u/18214951?v=4)](https://github.com/AdamHebby "AdamHebby (3 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (2 commits)")[![sylae](https://avatars.githubusercontent.com/u/2791628?v=4)](https://github.com/sylae "sylae (2 commits)")[![Hunman](https://avatars.githubusercontent.com/u/7405480?v=4)](https://github.com/Hunman "Hunman (1 commits)")[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (1 commits)")[![arcdigital](https://avatars.githubusercontent.com/u/551002?v=4)](https://github.com/arcdigital "arcdigital (1 commits)")[![ChalyFlavour](https://avatars.githubusercontent.com/u/15111583?v=4)](https://github.com/ChalyFlavour "ChalyFlavour (1 commits)")[![Divi](https://avatars.githubusercontent.com/u/1122160?v=4)](https://github.com/Divi "Divi (1 commits)")

### Embed Badge

![Health badge](/badges/valzargaming-yasmin/health.svg)

```
[![Health](https://phpackages.com/badges/valzargaming-yasmin/health.svg)](https://phpackages.com/packages/valzargaming-yasmin)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k12](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
