// ...
use NotificationChannels\Discord\DiscordChannel;
use NotificationChannels\Discord\DiscordMessage;
class GameChallengeNotification extends Notification
{
public $challenger;
public $game;
public function __construct(Guild $challenger, Game $game)
{
$this->challenger = $challenger;
$this->game = $game;
}
public function via($notifiable)
{
return [DiscordChannel::class];
}
public function toDiscord($notifiable)
{
return DiscordMessage::create("You have been challenged to a game of *{$this->game->name}* by **{$this->challenger->name}**!");
}
}
shell
php artisan discord:setup
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.