implement PluginV2 for script plugins

This commit is contained in:
RaidMax
2023-04-04 18:24:13 -05:00
parent ad20572879
commit fab3cf95d6
33 changed files with 1659 additions and 1026 deletions

View File

@ -27,11 +27,18 @@ public class InteractionController : BaseController
}
ViewBag.Title = interactionData.Description;
var meta = HttpContext.Request.Query.ToDictionary(key => key.Key, value => value.Value.ToString());
var result = await _interactionRegistration.ProcessInteraction(interactionName, Client.ClientId, meta: meta, token: token);
var result = await _interactionRegistration.ProcessInteraction(interactionName, Client.ClientId, token: token);
return interactionData.InteractionType == InteractionType.TemplateContent
? View("Render", result ?? "")
: Ok(result);
if (interactionData.InteractionType == InteractionType.TemplateContent)
{
return View("Render", result ?? "");
}
return new ContentResult
{
Content = result,
ContentType = interactionData.DisplayMeta ?? "text/html"
};
}
}