Closed quinchs closed 2 years ago
This PR adds the InteractionResponseCallback property to RestInteractionContext and introduces the interface IRestInteractionContext. This allows the process of writing the respond function much simpler, ex:
InteractionResponseCallback
RestInteractionContext
IRestInteractionContext
async Task WriteCallback(string payload) { await response.OutputStream.WriteAsync(payload); } var context = new RestInteractionContext(client, interaction, WriteCallback); await interactionService.ExecuteCommandAsync(context, services); response.StatusCode = 200; response.Close();
If no callback is passed into the ctor of RestInteractionContext then the default global callback is used, the callbacks are mutually exclusive.
cc: @Cenngo
Summary
This PR adds the
InteractionResponseCallback
property toRestInteractionContext
and introduces the interfaceIRestInteractionContext
. This allows the process of writing the respond function much simpler, ex:If no callback is passed into the ctor of
RestInteractionContext
then the default global callback is used, the callbacks are mutually exclusive.