Home - marcocusano/discord-php GitHub Wiki
Introduction
You’ve found the Discord PHP lib Documentation! This page is dedicated to showing you all the ways that you can use Discord to make cool stuff through a web page. Whether you’re looking to create awesome bots for your community, empower your applications with this Lib. Create awesome bot and customized actions!
- If you are looking for a first configuration, you must click here.
- If you are looking to use this lib on a WebServer only you must use functions only as described to the Resources area.
- If you are looking to use this lib to make your own Discord Bot, you must check the Bot section, and follow all the steps to setup, configure and code of your own.
Legal
This library has been developed to simplify all website and web application developers who wish to connect to Discord and who use PHP as a programming language. You can also use this library to create your own bots coding in PHP! Everything to support the Wumpus!
Please feel free to share this library with anyone, as long as you follow the guidelines of the GPL 3.0.
References
You will never need to specify endpoints, just call functions to get all the information you need, sometimes passing parameters, others cuddling a Wumpus puppy ... Be careful! Don't touch his tail, he might run away!
Resources
Let's start coding, I know, You are more excited than me!
Channels
How to use $discord->channels functions.
Gateway
How to use $discord->gateway functions.
Guilds
How to use $discord->guilds functions.
Invites
How to use $discord->invites functions.
Medias
How to use $discord->medias functions.
oAuth2
How to use $discord->oauth2 functions.
Users
How to use $discord->users functions.
WebHooks
How to use $discord->webhooks functions.
Bot
This is one of the first, simpler but at the same time one of the most powerful Discord libraries ever created for PHP developers, as long as you are able to use it on WebServer and/or as PHP CLI script.
Before coding your bot you must follow these steps to configure it, running the discord-php as bot and not only for cURL requests:
- Get and first configure this lib as described here
- Extract
/vendor.zipin the same folder - Go to the
/config.jsonfile and setrun_bot : true
Events
Now you must understand how to manage the bot events, everything described here.
Write your code
How to create your own code and manage each event.
Ready to play
You are now ready to test your bot then:
- Run
php ./discord.phpscript when you are ready.