revolution/discord-manager

Discord Manager

1.4.2 2020-08-28 07:18 UTC

This package is auto-updated.

Last update: 2020-08-28 07:22:54 UTC


README

Build Status Maintainability Test Coverage

Requirements

  • PHP >= 7.2
  • Laravel >= 6.0 or other illuminate base project

Installation

composer require revolution/discord-manager

config/services.php

    'discord' => [
        'prefix'    => '/',
        'not_found' => 'Command Not Found!',
        'path'      => [
            'commands' => app_path('Discord/Commands'),
            'directs'  => app_path('Discord/Directs'),
        ],
        'token'     => env('DISCORD_BOT_TOKEN'),
        'channel'   => env('DISCORD_CHANNEL'),
        'bot'       => env('DISCORD_BOT'),
        'yasmin'    => [
            'ws.disabledEvents' => [
                'TYPING_START',
            ],
        ],
    ],

.env

DISCORD_BOT_TOKEN=
DISCORD_CHANNEL=
DISCORD_BOT=

make command

php artisan make:discord:command NewChannelCommand
php artisan make:discord:direct NewDmCommand

Yasmin

use Revolution\DiscordManager\Facades\Yasmin;
use CharlotteDunois\Yasmin\Models\Message;


Yasmin::on('ready', function () {
    $this->info(Yasmin::user()->tag);
});

Yasmin::on('message', function (Message $message) {

});

Yasmin::login('token');
Yasmin::getLoop()->run();

RestCord

use Revolution\DiscordManager\Facades\RestCord;

RestCord::channel()->createMessage([
  'channel.id' => 0,
  'content' => 'test',
]);

https://github.com/restcord/restcord

LICENSE

MIT
Copyright kawax