Download the PHP package ilyahoilik/discord-notification-channel without Composer

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

Discord notification channel for Laravel 6.0+

Latest Version on Packagist Build Status StyleCI Quality Score Code Coverage Total Downloads

This package makes it easy to send notifications using the Discord bot API with Laravel.

Contents

Installation

You can install the package via composer:

Next, you must load the service provider:

Setting up your Discord bot

  1. Create a Discord application.
  2. Click the Create a Bot User button on your Discord application.
  3. Paste your bot's API token, found under App Bot User, in your services.php config file:

  4. 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:

  1. Your users table has two discord columns: discord_user_id and discord_private_channel_id
  2. When a user updates their Discord user ID (discord_user_id), generate and save a private channel ID (discord_private_channel_id)
  3. Return the user's discord_private_channel_id in the routeNotificationForDiscord method on the User model

You can generate direct message channels by using the getPrivateChannel method in the NotificationChannels\Discord\Discord class

Please take note that the getPrivateChannel method only accepts Discord's snowflake IDs. There is no API route provided by Discord to lookup a user's ID by their name and tag, and the process for copying and pasting a user ID can be confusing to some users. Because of this, it is recommended to add the option for users to connect their Discord account to their account within your application either by logging in with Discord or linking it to their pre-existing account.

You may now tell Laravel to send notifications to Discord channels in the via method:

Available Message methods

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

License

The MIT License (MIT). Please see LICENSE for more information.


All versions of discord-notification-channel with dependencies

PHP Build Version
Package Version
Requires ext-json Version *
guzzlehttp/guzzle Version ^6.3 || ^7.0
textalk/websocket Version ^1.2
illuminate/notifications Version ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0
illuminate/support Version ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0
illuminate/queue Version ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0
illuminate/console Version ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0
php Version ^8.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 ilyahoilik/discord-notification-channel contains the following files

Loading the files please wait ....