Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork4
Symfony Discord Notifier Bridge
License
NotificationsYou must be signed in to change notification settings
symfony/discord-notifier
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
ProvidesDiscord integration for Symfony Notifier.
DISCORD_DSN=discord://TOKEN@default?webhook_id=IDwhere:
TOKENthe secure token of the webhook (returned for Incoming Webhooks)IDthe id of the webhook
With a Discord message, you can use theDiscordOptions class to add someinteractive options called Embedelements.
useSymfony\Component\Notifier\Bridge\Discord\DiscordOptions;useSymfony\Component\Notifier\Bridge\Discord\Embeds\DiscordEmbed;useSymfony\Component\Notifier\Bridge\Discord\Embeds\DiscordFieldEmbedObject;useSymfony\Component\Notifier\Bridge\Discord\Embeds\DiscordFooterEmbedObject;useSymfony\Component\Notifier\Bridge\Discord\Embeds\DiscordMediaEmbedObject;useSymfony\Component\Notifier\Message\ChatMessage;$chatMessage =newChatMessage('');// Create Discord Embed$discordOptions = (newDiscordOptions()) ->username('connor bot') ->addEmbed((newDiscordEmbed()) ->color(2021216) ->title('New song added!') ->thumbnail((newDiscordMediaEmbedObject()) ->url('https://i.scdn.co/image/ab67616d0000b2735eb27502aa5cb1b4c9db426b')) ->addField((newDiscordFieldEmbedObject()) ->name('Track') ->value('[Common Ground](https://open.spotify.com/track/36TYfGWUhIRlVjM8TxGUK6)') ->inline(true) ) ->addField((newDiscordFieldEmbedObject()) ->name('Artist') ->value('Alasdair Fraser') ->inline(true) ) ->addField((newDiscordFieldEmbedObject()) ->name('Album') ->value('Dawn Dance') ->inline(true) ) ->footer((newDiscordFooterEmbedObject()) ->text('Added ...') ->iconUrl('https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Spotify_logo_without_text.svg/200px-Spotify_logo_without_text.svg.png') ) );// Add the custom options to the chat message and send the message$chatMessage->options($discordOptions);$chatter->send($chatMessage);
About
Symfony Discord Notifier Bridge
Topics
Resources
License
Code of conduct
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
No packages published