botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

.Net FormFlow field with a [Prompt("{||}")] attribute causes exception when connected via Facebook Messenger

Open LMEdwards opened this issue 10 years ago • 5 comments

.Net FormFlow field with a [Prompt("{||}")] attribute causes the following error when connected to Facebook Messenger:

{"error":{"message":"(#100) Param [text] must be a non-empty UTF-8 encoded string","type":"OAuthException","code":100,"fbtrace_id":"F5k9NGkkYHr"}}

[Prompt(" {||}")] also fails. [Prompt("X{||}")] does not. Other channels (Skype, Slack, WebChat) do not fail with [Prompt("{||}")].

LMEdwards avatar Nov 16 '16 21:11 LMEdwards

Any luck ? i'm having the same issue it seems its related to ChoiceStyle = ChoiceStyleOptions.Default if you select ChoiceStyle = ChoiceStyleOptions.PerLine it should work but with a textual menu

rexad avatar Nov 20 '16 01:11 rexad

So i was able to fix this issue : please update your bot framework to version 3.3.3.0 put [Describe(Title = "", SubTitle = "")] at the top of the variable representing the enum in my case [Describe(Title = "", SubTitle = "")] public FeatureOptions? Menu; i think facebook make it mandatory to have the title and microsoft please update your sample et voila .

rexad avatar Nov 21 '16 08:11 rexad

I'm still having problem:

@rexad 's solution does not work for me and @chrimc62 's commit as I can see is roll backed as it was braking change. Below is a code:

[Describe(Title = "", SubTitle = "")] [Prompt("Gender: {||}", ChoiceStyle = ChoiceStyleOptions.Buttons)] public EnumGender Gender { get; set; }

If I use Title="Test", than it works, but I don't want extra title. As soon as I put empty string, I get this error. Any ideas?

P.S. my BotBuilder version is 3.5.0

giorgobiani avatar Jan 21 '17 17:01 giorgobiani

Same issue with reply to Facebook: "SendActivityToUserAsync FAILED: {"error":{"message":"(#100) Param [elements][0][title] must be a non-empty UTF-8 encoded string","type":"OAuthException","code":100,"fbtrace_id":"BltwwnsCdZw"}}" Attached sample json sample.json.txt

vovanb avatar Feb 09 '17 18:02 vovanb

i think the fix not working anymore with the new build, i will take a look at it and be back with a solution.

rexad avatar Jun 13 '17 09:06 rexad