Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for issue #68: send embed and components only if filled #69

Conversation

deto1986
Copy link
Contributor

@deto1986 deto1986 commented Jan 4, 2024

note: discord have no documented embed attribute, it is called embeds and should be send as an array. Maybe in the older days it was called embed. I go with the current documentation here, see https://discord.com/developers/docs/resources/channel#create-message

note: discord have no documented `embed` attribute, it is called `embeds` and should be send as an array. Maybe in the older days it was called `embed`. I go with the current documentation here, see https://discord.com/developers/docs/resources/channel#create-message
@deto1986 deto1986 changed the title fix(#68): send embed and components only if filled fix for issue #68: send embed and components only if filled Jan 4, 2024
@dpslwk
Copy link

dpslwk commented Jan 4, 2024

api v10 takes the newer array "embeds",
not sure if the default api (v6) will,
since a version is not specified v6 will be used as per https://discord.com/developers/docs/reference

@dpslwk
Copy link

dpslwk commented Jan 4, 2024

ok quick test shows the if I foce v6 this works ok

@deto1986
Copy link
Contributor Author

deto1986 commented Jan 4, 2024

I have tested it, if nothing is specified the newer array "embeds" is working correctly.

@@ -31,16 +31,24 @@ public function __construct(Discord $discord)
*/
public function send($notifiable, Notification $notification)
{
if (! $channel = $notifiable->routeNotificationFor('discord', $notification)) {
if (!$channel = $notifiable->routeNotificationFor('discord', $notification)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suspect this change will fail StyleCI check since the default in Laravel is with the space

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have fixed it with another commit. I personally don't use StyleCI nor I have an integration in my IDE for that.

@winkcler
Copy link

winkcler commented Jan 6, 2024

I'm waiting for someone to approve this pull request.

@hashimotoryoh
Copy link

Thx for fixing. I'm waiting for merging this pr.

1 similar comment
@winkcler
Copy link

winkcler commented Jan 8, 2024

Thx for fixing. I'm waiting for merging this pr.

@deto1986
Copy link
Contributor Author

deto1986 commented Jan 8, 2024

For everyone who's waiting for this PR, maybe you can implement a workaround for your stuff. With a filled embed you don't run into this error. Maybe you can fill a embed with some useful data as a workaround until this PR is merged.

@Aurabolt
Copy link

Aurabolt commented Jan 9, 2024

I also would like to see this PR merged please

@LukasJK
Copy link

LukasJK commented Jan 13, 2024

Can this please be merged?

@zeerakahmad
Copy link

Why has this not been merged? Can someone please escalate and merge. 🙏

@deto1986
Copy link
Contributor Author

I have send an email to the maintainer @atymic I hope he responds quickly. Sadly only the maintainer can approve PRs.

I have also done some research, maybe @codyphobe or @arcdigital can merge this PR too.

@arcdigital
Copy link
Collaborator

I can take a look later today!

@atymic atymic merged commit 11ab1bf into laravel-notification-channels:master Jan 13, 2024
5 of 6 checks passed
@atymic
Copy link
Member

atymic commented Jan 13, 2024

Sorry guys, I didn't see the emails from github. Thanks @deto1986 for emailing me.

If anyone is interested in taking over maintenance of this channel please comment and we can have a chat.

@arcdigital
Copy link
Collaborator

Sorry guys, I didn't see the emails from github. Thanks @deto1986 for emailing me.

If anyone is interested in taking over maintenance of this channel please comment and we can have a chat.

I'm interested, I use this channel quite often.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants