Reputation: 43
Using MS Bot Framework and Facebook messenger as channel.
I have a short form that asks about Rarity(from an int list) and Variation(from an enum with two choices).
It works fine in Web Chat and Emulator but on messenger, it shows no buttons and no possible answers when you type help.
This is my code:
[Serializable]
public class RarityAndLevelForm
{
[Prompt("What is the {&} of your hero? {||}")]
public int? Rarity;
[Prompt("Chose {&} of your hero? {||}")]
public StatsVariation StatsVariation;
public static IForm<RarityAndLevelForm> BuildForm()
{
return new FormBuilder<RarityAndLevelForm>()
.Message("Answer the questions to get your hero's IVs. Type help for additional information or quit to cancel.")
.Field(new FieldReflector<RarityAndLevelForm>(nameof(Rarity))
.SetType(null)
.SetDefine((state, field) =>
{
foreach (var item in GetRarities())
{
field.AddDescription(item, item.ToString() + " Stars")
.AddTerms(item, item.ToString() + " Stars");
}
return Task.FromResult(true);
}))
.AddRemainingFields()
.Build();
}
static List<int> GetRarities()
{
var res = HeroService.GetHeroRarities();//List of integer numbers
return res;
}
}
}
Here is what should happen and is happening in Web Chat but not in messenger:
Here is what I get in messenger:
I have almost the same code for another form and it works just fine, but for some reason, it's not working for that field. Anyone got an idea how to fix this, because i could not find anything that could help me solve this ?
Upvotes: 0
Views: 278
Reputation: 14787
Can you please try to update to the latest version of the BotBuilder SDK (currently v3.8.0)? It could be possible that between the version you are using and current one, fixes were made that might affect the behavior you are seeing.
Upvotes: 1