Skip to content

frf/discord-message

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Discord Message

Send messsage to discord hook

N|Solid

Build Status

Project created to decouple the sending of messages to disagree, and in this way keep the project without fixed dependency. Sending messages through the discord hook can facilitate the communication of errors, warn when a tariff ends, among many benefits.

Features

  • Send message to channel discord with hook

Future Features

  • Send message to multiple channel discord with hook
  • Integration Notification Laravel

Installation

Laravel Discord Message requires PHP Laravel v8+ to run.

Install the package

composer require frf/discord-notification

After install - Create Discord Hook

Open your channel config and create integration

App Screenshot

Add name your hook and choose your channel

App Screenshot

Put end of file .env configuration link hook in your .env

DISCORD_HOOK=https://discord.com/api/webhooks/4334343/XaFx43434343lGHYvQHoQO0ykhGRibx3w

Exemple to use command line

php artisan discord:send_message Teste
php artisan discord:send_message Teste warning

Exemple to use injection service,

Remembering that there is no better place on the controller 😅, I put it just as a practical example

<?php

use Frf\DiscordNotification\Services\DiscordService;
use Illuminate\Support\Facades\Route;

Route::get('/', function (DiscordService $discordService) {

    $discordService
    ->title('Mensagem Teste')
    ->description('Descricao')
    ->footer('Footer')
    ->success()
    ->timestamp(Carbon::now())
    ->send();

    return view('welcome');
});

Result

App Screenshot

License

MIT

Free Software, Hell Yeah!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages