Download the PHP package fabrizio/laravel-restcord without Composer

On this page you can find all versions of the php package fabrizio/laravel-restcord. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-restcord

laravel-restcord (Laravel 8)

The repository is a fork of more-cores/laravel-restcord, it was updated to be compatible with PHP 8 and recent versions of Laravel.

A small, fluent wrapper for Restcord.

README Contents

Features

Installation

  1. Install package

  2. Define the DISCORD_BOT_TOKEN environmental variable.
  3. Add the middleware sessionHasDiscordToken for the routes where you need to use the current OAuth'd user's credentials to interact with the Discord API. This is required because session information is not available in a ServiceProvider.

  4. For Laravel <= 5.4, register the service provider in config/app.php

Environment Variables

  • DISCORD_BOT_KEY
  • DISCORD_BOT_SECRET
  • DISCORD_BOT_TOKEN
  • DISCORD_KEY
  • DISCORD_SECRET

Bot key/secret will be used for callback endpoints related to adding a bot or creating a webhook as well as when the application is running in the console such as queue workers and cron.

Usage

This documentation assumes your users are logging in via the Discord driver for Laravel Socialite.

Anytime you see $discord in this documentation it is assumed to be an instance of LaravelRestcord\Discord\Discord::class which is available from Laravel's IOC container.

Guilds

Get a list of guilds the current user has access to:

Get information about a user's relationship with a guild

Adding Bots To Guilds

This implementation uses the Advanced Bot Authorization flow to add the bot to a guild. You should have the Require OAuth2 Code Grant option enabled on your app's settings.

Next, add a binding to your AppServiceProvider so the package knows which class to pass the guild information to when the user returns to your web site.

Now you're ready to direct the user to Discord's web site so they can select the guild to add the bot to:

This package handles the routing needs, but you need to whitelist the callback URL for this to work. Add http://MY-SITE.com/discord/bot-added to your application's redirect uris.

Your handler will be trigger when the bot has been added to a guild.

You will be able to send messages via this bot once it has established a web socket connection. It only has to do this once, so it's a common practice to use the below code snippet to do so:

Creating Webhooks

Because we're using OAuth to create webhooks, the user will be directed to Discord's web site to select the guild/channel. This package handles interpreting the request/response lifecycle for this, so all you need to do is build a handler:

Next, add a binding to your AppServiceProvider so the package knows which class to pass the webhook data to when the user returns to your web site.

Now you're ready to direct the user to Discord's web site to create the webhook:

This package handles the routing needs, but you need to whitelist the callback URL for this to work. Add http://MY-SITE.com/discord/create-webhook to your application's redirect uris.

Your handler will be trigger when the webhook is created.


All versions of laravel-restcord with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0
illuminate/support Version ^6.0|^7.0|^8.0|^9.0
restcord/restcord Version dev-develop
laravel/socialite Version ^5.5
illuminate/contracts Version ^6.0|^7.0|^8.0|^9.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package fabrizio/laravel-restcord contains the following files

Loading the files please wait ....