MarcosNicolau / whatsapp-business-sdk

Node.js connector for the WhatsApp Business APIs with TypeScript support, integration tests and more.
MIT License
81 stars 21 forks source link

Type error with "TemplateMessageButtonParameter" #39

Closed JulianGarcia04 closed 2 months ago

JulianGarcia04 commented 2 months ago

I have a error with this type when i try to set button parameters.

Screenshot 2024-07-30 at 9 50 44 AM

And I try to change the type for a custom type...

Screenshot 2024-07-30 at 9 53 35 AM

And it show this error.

Because "TemplateMessageButtonParameter" has a "GenerateMappedNever" being the problem

Screenshot 2024-07-30 at 9 54 53 AM

And another problem is that when I try set a component with type equal to "button", the paramaters must be "TemplateMessageButtonParameter" and it doesn't change the type from "TemplateMessageParameter[]" to TemplateMessageButtonParameter[]", and I can't set a parameter with type equal "payload".

A image with more details of the problem...

Screenshot 2024-07-30 at 10 16 24 AM

Some solution ???

Thanks

MarcosNicolau commented 2 months ago

I'll try to take a look later on.

MarcosNicolau commented 2 months ago

I don't understand, is this library bug or it is something in your code?

JulianGarcia04 commented 2 months ago

The bug is from library. Because when I set a component as button type then the parameter type must be change to TemplateMessageButtonParameter[].

JulianGarcia04 commented 2 months ago

Another error is the TemplateMessageButtonParameter is bad. Because it is doing merge with GenerateMappedNever and the type parameter change to never.

JulianGarcia04 commented 2 months ago

Problem solve in pull request #43

tecoad commented 2 months ago

Thanks for this @JulianGarcia04 , I just came across this issue yesterday when sending a template message by the first time :)