An API to interact with the popular text and voice service Discord.
- Chris Boden for the WebSocket client that is based off RatchetPHP/Pawl
Todo list is available in the TODO.md
file.
<?php
include 'vendor/autoload.php';
use Discord\Discord;
use Discord\WebSockets\Event;
use Discord\WebSockets\WebSocket;
$discord = new Discord(':email', ':password');
$websocket = new WebSocket($discord);
$websocket->on(Event::MESSAGE_CREATE, function ($message, $discord, $new) {
echo "New message from {$message->author->username}: {$message->content}".PHP_EOL;
});
$websocket->run();
Documentation can be found here, however it is very basic at the moment. If you need more help please ask as it says below.
If you need any help feel free to join the DiscordAPI Server and ask in the #php_discordphp
channel. Tag @Uniquoooo
if you need any help specific to the API.
Here is a list of the other libraries that are being worked on and their Discord usernames!
- Discord.Net - @Voltana
- DiscordSharp - @Axiom
- go-discord - @steelou
- discordgo - @Skippy (siacn)
- discord.io - @izy521
- discord.js - @hydrabolt
- discordie - @#q
- discord-hypertext - @Cleanse
- discord.py - @Danny
- discordrb - @meew0
- discord-akka - @ceezy
We are open to anyone contributing as long as you follow our code standards. We use PSR-4 for our autoloading standard and PSR-2 for our code formatting standard. Please, if you send in pull requests follow these standards.