Download the PHP package aedon/discord-bot without Composer
On this page you can find all versions of the php package aedon/discord-bot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aedon/discord-bot
More information about aedon/discord-bot
Files in aedon/discord-bot
Package discord-bot
Short Description A PHP bot implementation for Discord.
License MIT
Informations about the package discord-bot
Aedon Discord Bot
A Discord bot implementation written in PHP. Use this library to create your own bot.
- Integrates the Discord websocket API (receiving events from Discord)
- Adds basic support for the Discord REST API (sending commands to Discord)
- Supports API v6
Missing features
- Does not resume lost connections
- No support for voice channels
Requirements
PHP 7.4+ or PHP 8.0+
Required extensions:
- ext-curl
- ext-json
- ext-mbstring
Getting your bot up and running
You have created a Discord bot and it's now in your server but offline all day... Let's start!
Bring your bot to life
Create a PHP file and run it from the command line.
Even though your bot won't do much for now it should actually be online and it should receive heartbeat events in the console.
Subscribe to events
The bot receives events from Discord now. You can subscribe to a specific event or all events. In this example you will listen to MESSAGE_CREATE events.
Let the bot do something in Discord
The bot library has very basic support for the Discord REST API that is used to e.g. create a message in Discord. For more information about the Discord REST API check out the documentation.
Add the RestApiSubscriberInterface to your subscriber and it will get access to the rest api object.
The bot will listen for MESSAGE_CREATE events and when someone writes "/roll" it will answer back to the user with "Roll Result (1-6): X".
Support
Join Discord: https://discord.gg/NEfRerY
Aedon Discord Bot created by Michael "Striker" Berger
All versions of discord-bot with dependencies
ext-curl Version *
ext-json Version *
ext-mbstring Version *
psr/log Version ^1.1.2
ratchet/pawl Version ^0.3.5
aedon/php-expectations Version ^0.9.6