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

New viber features #36

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

DimitriosGkegkas
Copy link
Collaborator

You can check out this new features for Viber's location, share-phone, tracking_data and events webhook.

In the following days I will work on polishing some things and creating a clean viber template solution (in order to better bootstrap viber bots, admin panels and such features). If any further problem or need arises I'll enhance this pull request, until then I would love your feedback thus far.

@DimitriosGkegkas DimitriosGkegkas marked this pull request as draft February 28, 2022 17:25
Copy link
Owner

@chrispanag chrispanag left a comment

Choose a reason for hiding this comment

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

Can you explain more elaborately, the additions here? (like bullet points)

examples/viber-demo-bot/src/bot.ts Outdated Show resolved Hide resolved
@DimitriosGkegkas
Copy link
Collaborator Author

So we have 4 main enhancements

  1. Add the contact info as part of the payload that an action has to handle
    Files Affected
    packages/framework/lib/adapter.ts
    packages/framework/lib/handlers/text.ts
    packages/framework/lib/interfaces/payload.ts

  2. Fix and export More types
    Files Affected for Export
    packages/framework/lib/index.ts
    packages/viber-adapter/lib/index.ts
    Files Affected for Type Fix
    packages/framework/lib/interfaces/nlp.ts (New Wit NLP version)
    packages/framework/lib/interfaces/trackingData.ts (Tracking Data has no real meaning of being anything else than an object)
    packages/viber-adapter/lib/interfaces/message_types.ts (text is not an optional property)
    packages/framework/lib/modules/index.ts (Delete the addBaseLocationRule functionality cause it serves no purpose and also change the payload as always defined (text property is always in the payload as it is a text rule))

  3. Events Webhook
    The adaptor can now take costume action-like function in order for them to be executed when a specific event is fired. We had a messageWebhook for the event message but we did not take any action for all the other events (we were simply console the event). Now we can take specific action when an event is triggered (like change a property subscribe in our database, or what ever). This is important specific in the case of the subscription event where we want to send a message to the user (most likely the welcome message). This issue appeared in the first production bot were we lost many users due to our inability to respond to the subscription event.

@DimitriosGkegkas
Copy link
Collaborator Author

Things are looking pretty stable here. I am finishing with the Viber Template Bot as well. So we can check out what we need to do in order to have a new version @chrispanag

@DimitriosGkegkas DimitriosGkegkas requested review from chrispanag and removed request for chrispanag March 10, 2022 09:42
@chrispanag
Copy link
Owner

I'll check it out in the weekend!

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.

2 participants