Download the PHP package laravel54-notification-channels/discord without Composer
On this page you can find all versions of the php package laravel54-notification-channels/discord. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laravel54-notification-channels/discord
More information about laravel54-notification-channels/discord
Files in laravel54-notification-channels/discord
Package discord
Short Description Laravel notification driver for Discord.
License MIT
Homepage https://github.com/laravel-notification-channels/discord
Informations about the package discord
Discord notification channel for Laravel 5.3
This package makes it easy to send notifications using the Discord bot API with Laravel 5.3.
Contents
- Installation
- Setting up your Discord bot
- Usage
- Available Message methods
- Changelog
- Testing
- Security
- Contributing
- Credits
- License
Installation
You can install the package via composer:
Next, you must load the service provider:
Setting up your Discord bot
- Create a Discord application.
- Click the
Create a Bot User
button on your Discord application. -
Paste your bot's API token, found under
App Bot User
, in yourservices.php
config file: - Add the bot to your server and identify it by running the artisan command:
Usage
In every model you wish to be notifiable via Discord, you must add a channel ID property to that model accessible through a routeNotificationForDiscord
method:
NOTE: Discord handles direct messages as though they are a regular channel. If you wish to allow users to receive direct messages from your bot, you will need to create a private channel with that user. An example workflow may look like the following:
- Your
users
table has two discord columns:discord_user
anddiscord_channel
- When a user updates their Discord user ID (
discord_user
), generate and save a channel ID (discord_channel
)- Return the user's
discord_channel
in therouteNotificationForDiscord
method on the User modelYou can generate direct message channels by using the
getPrivateChannel
method inNotificationChannels\Discord\Discord
:
You may now tell Laravel to send notifications to Discord channels in the via
method:
Available Message methods
body(string)
: Set the content of the message. (Supports basic markdown)embed(array)
: Set the embedded content. (View embed structure)
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
- Cody Scott
- All Contributors
License
The MIT License (MIT). Please see LICENSE for more information.
All versions of discord with dependencies
guzzlehttp/guzzle Version ^6.2
illuminate/notifications Version 5.3.*
illuminate/support Version 5.1.*|5.2.*|5.3.*
illuminate/queue Version 5.1.*|5.2.*|5.3.*
illuminate/console Version 5.1.*|5.2.*|5.3.*
textalk/websocket Version 1.0.*