Update (08/09/2016)
Since latest release (3.2.0), thanks for the commit (https://github.com/Microsoft/BotBuilder/commit/f156a60880e86f7b853b1f94a5546386436ac3d0)
Now we are able to get the activity directly from the intent handler
Sample code
public async Task Test(IDialogContext context, IAwaitable<IMessageActivity> origin, LuisResult result)
Original answer (05/08/2016)
You can have a property to store the origin activity and assign it in MessageReceived
public class YourDialog : LuisDialog<string>
{
[NonSerialized]
private IMessageActivity _originActivity;
internal YourDialog()
{
}
[LuisIntent("IntentionConstant.Empty")]
public async Task HandleLuisResult(IDialogContext context, LuisResult result)
{
try
{
// you can access _originActivity here
}
catch (Exception ex) when(ex is ApplicationException)
{
throw;
}
catch (Exception ex) when (ex is TaskCanceledException)
{
}
}
protected override async Task MessageReceived(IDialogContext context, IAwaitable<IMessageActivity> item)
{
_originActivity = await item;
await base.MessageReceived(context, item);
}
}