tawn33y / whatsapp-cloud-api

A Node.js library for creating bots and sending/receiving messages using the Whatsapp Cloud API.
https://www.npmjs.com/package/whatsapp-cloud-api
GNU General Public License v3.0
189 stars 51 forks source link

feature/issue-21 Adds sender name to message #25

Closed guskuma closed 2 years ago

guskuma commented 2 years ago

This fix #21

Adds sender name to message. Changes "from" field to object with wa_id (sender number) and name

tawn33y commented 2 years ago

@guskuma I just realized that having the name property under the from object is not the best course of action as it will mean current users will have to change their code from using from directly as the phone number/whatsapp id to reading it from from.wa_id.

This means that the change will be breaking. For breaking changes, I'd prefer slowly decrementing a method/functionality before fully removing it.

Thus, for now, I'd recommend we use something simpler:

export interface Message {
  from: string;
  // add the name here
  name: string;
  id: string;
  timestamp: string;
  type: PubSubEvent;
  data: FreeFormObject;
}
guskuma commented 2 years ago

That's OK for me @tawn33y , and that's why I asked before. If it works it's fine for me!

tawn33y commented 2 years ago

Yep. You can do the change, I can approve and we can merge.

guskuma commented 2 years ago

Hey @tawn33y change done! Please review.

RyzorBent commented 2 years ago

@tawn33y i think the change was done to put the name as part of the message object, which makes it a non-breaking change. Unless I'm missing something from @guskuma's change.

guskuma commented 2 years ago

Yes, maybe I'm missing something too. I've done changes this commit. Please tell me if there's something else I need to do.

tawn33y commented 2 years ago

@RyzorBent @guskuma I've tagged you in the comments again. Kindly confirm if you can see them.

guskuma commented 2 years ago

Hello @tawn33y , I can't see any comments I was tagged... where can I find it? I didn't receive any e-mail either.

tawn33y commented 2 years ago

@guskuma @RyzorBent I meant this comment:

image

And this one:

image

tawn33y commented 2 years ago

I've made the changes. Approving the PR.

Sorry if we had a break of communication somewhere, but thanks for making the changes! @guskuma @RyzorBent @j05u3 😃

j05u3 commented 2 years ago

I've made the changes. Approving the PR.

Sorry if we had a break of communication somewhere, but thanks for making the changes! @guskuma @RyzorBent @j05u3 😃

thanks a lot, can't wait for the next release 🙏

tawn33y commented 2 years ago

@j05u3 @guskuma @RyzorBent This is now live: https://github.com/tawn33y/whatsapp-cloud-api/releases/tag/v0.2.6

npm link: https://www.npmjs.com/package/whatsapp-cloud-api

Feel free to test & create a new issue in case of any issues. Hopefully though, there are none. 😄

RyzorBent commented 2 years ago

Brilliant, :) ... will test and feedback.

On Fri, Sep 2, 2022 at 7:17 PM Tony @.***> wrote:

@j05u3 https://github.com/j05u3 @guskuma https://github.com/guskuma @RyzorBent https://github.com/RyzorBent This is now live: https://github.com/tawn33y/whatsapp-cloud-api/releases/tag/v0.2.6

Feel free to test & create a new issue https://github.com/tawn33y/whatsapp-cloud-api/issues in case of any issues. Hopefully though, there are none. 😄

— Reply to this email directly, view it on GitHub https://github.com/tawn33y/whatsapp-cloud-api/pull/25#issuecomment-1235738521, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADX7JL6EN2IR2DA6LZUHB5DV4IZCHANCNFSM56CKNUYA . You are receiving this because you were mentioned.Message ID: @.***>

guskuma commented 2 years ago

@tawn33y sorry for miscomunication! I really could not see what was going on (my fault, maybe from my lack of experience here). I'll be more diligent next time! Thank you!

tawn33y commented 2 years ago

Hi @guskuma, Don't worry about it at all! We learn a new thing every day. Feel free to keep contributing to the library, happy to have your contributions 😊