Download the PHP package reysa/discord-api without Composer

On this page you can find all versions of the php package reysa/discord-api. 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 discord-api

Reysa Discord API (v1)

A small Laravel helper package for working with parts of the Discord HTTP API.

Note: This is version 1 of the package. It does not cover all Discord API endpoints yet.
More endpoints and features will be added in future versions.

Official Discord API documentation:
https://discord.com/developers/docs/intro


Features (v1)

Currently supported helpers:


Requirements

Check composer.json for exact constraints, but the package is designed to work with:


Installation

Install the package via Composer:

composer require reysa/discord-api

Laravel’s package auto-discovery will automatically register the service provider and facade.

You can also find the package on Packagist:

https://packagist.org/packages/reysa/discord-api


Configuration

Publish the config file:

php artisan vendor:publish --tag=discord-api-config

This will create config/discord-api.php in your Laravel application:


sendEmbedMessageToUser(string $userId, array $payload): Response|false

Send a rich embed (or any valid Discord message payload) to a user via DM.

$payload = [
    'content' => 'Optional text',
    'embeds'  => [
        [
            'title'       => 'Hello!',
            'description' => 'This is an embed message',
            'color'       => 0x7289DA,
        ],
    ],
];

DAPI::sendEmbedMessageToUser($userId, $payload);

sendMessageToChannel(string $channelId, array $payload): Response

Send a message to a specific channel.

DAPI::sendMessageToChannel('123456789012345678', [
    'content' => 'Hello channel!',
]);

getChannelMessage(string $channelId, string $messageId): Response

Retrieve a single message from a given channel.

$message = DAPI::getChannelMessage($channelId, $messageId);

getChannelMessages(string $channelId): Response

Retrieve recent messages from a given channel.

$messages = DAPI::getChannelMessages($channelId);

editChannelEmbedMessage(string $channelId, string $messageId, array $embeds): Response

Edit an existing message’s embeds in a channel.

DAPI::editChannelEmbedMessage($channelId, $messageId, [
    [
        'title'       => 'Updated title',
        'description' => 'Updated description',
    ],
]);

Versioning & Roadmap


Contributing

Issues and pull requests are welcome.


License

This project is open-source software licensed under the MIT license.
See the LICENSE file for details.


All versions of discord-api with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
illuminate/support Version ^7.0|^8.0|^9.0|^10.0|^11.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 reysa/discord-api contains the following files

Loading the files please wait ...