-
Notifications
You must be signed in to change notification settings - Fork 281
how to remove "Choose an item" text before suggestion #76
Comments
Same here, how do we change this? Thanks! |
So, what I did was go into constructor(suggestion) {
super();
this.platform = undefined;
this.replies = [];
this.title = "Choose an item:" Then, I set the value of } else if (typeof suggestion === 'object') {
this.replies.push(suggestion.reply)
this.title = suggestion.title Lastly, I modified the } else if (platform === PLATFORMS.FACEBOOK) {
response = {
quickReplies: {
title: this.title,
quickReplies: this.replies
}
}
} Once that's done, you can make quick replies like this. First, make the first one with a title: const quickReplies = new Suggestion({
title: "My custom message",
reply: "Option 1"
}) And then add the rest of the options like so: quickReplies.addReply_("Option 2")
quickReplies.addReply_("Option 3")
quickReplies.addReply_("Option 4") Lastly, agent.add(quickReplies) And it works! |
In case anyone's interested, here's my fork, the complete edited file, and the edits (Git diff). |
hey @naranjja I made the changes in the respective folder (suggestions-response,js) but for some reasons those changes are not being reflected, is there anything more than just saving the file that I need to do ? |
I installed your github module itself, it works perfectly. Thanks @naranjja |
hey guys, I'm new to this platform, how do I use this @naranjja code in my project? How would they require them? |
@TexugoGaio In your project's {
"dialogflow-fulfillment": "git+https://github.com/naranjja/dialogflow-fulfillment-nodejs.git"
} |
thank you very much @naranjja, it worked perfectly! |
Since this is a platform specific feature, it won't be supported in the library. If you'd like to use platform-specific responses, I'd recommend using the payload response type |
@matthewayne Appreciate the great library, cheers for the great work. The issue with a quick reply payload is the limitation of not being able to send fulfillment messages along with a custom payload. The solution above supplied by @naranjja is a good work around until this functionality is added. There is a pull request pending that elevates this limitation. (#113) Any chance of getting this merged any time soon? Would be very useful for my current use case. Cheers. |
@matthewayne is there no way to change the
message on Facebook messenger without using Payload? Or to implement the feature without it needing to be platform specific. |
@matthewayne I understand what you're saying and the design choice. But the reality of this choice push developers to fork and use their own implementation of your library, which is really not a good thing. Stepping back a bit, and after using this lib for 2 days, I can tell a proper abstraction of the specificities of each Platform is a must-have. For instance, in my case I need to deal with both Facebook and Web integrations, and I ended up writing wrappers around basic stuff like Text or Suggestion. If you don't want to write custom integration code in this library, so be it. What do you think about writing a wrapper of your own library, or a bunch of helpers to deal with each platform specificities? It's something the community will need on the long-run. Also, your link to payload response type is dead. |
i solved using a custom payload as @matthewayne suggested: this way no fork is needed /cc @Vadorequest i'm using somthing like this
|
@magnum I don't understand why you send |
just saying this way you can customize it, for example translate it (that was my need) or for example not use it. |
How would this work for Telegram? |
Tried this code but it worked only in the Dialogflow simulator not inside Facebook messenger... |
let payload = new Payload(agent.FACEBOOK, { That works for me in the FB messenger as well. |
what is dialogflow-fulfillment version which you editted? |
what is dialogflow-fulfillment version which you editted? |
Anytime I add Suggestion to agent, on facebook there's always a text added saying "Choose an item"
how can it be removed or translated?
The text was updated successfully, but these errors were encountered: