Skip to content
Marco Cusano edited this page Jun 4, 2019 · 10 revisions

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!

How to use $discord->channels functions.

How to use $discord->gateway functions.

How to use $discord->guilds functions.

How to use $discord->invites functions.

How to use $discord->medias functions.

How to use $discord->oauth2 functions.

How to use $discord->users functions.

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.zip in the same folder
  • Go to the /config.json file and set run_bot : true

Now you must understand how to manage the bot events, everything described here.

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.php script when you are ready.