Open vorontsoved opened 3 months ago
export class MyApp extends App implements IUIKitInteractionHandler {
public async executeActionButtonHandler(
context: UIKitActionButtonInteractionContext,
read: IRead,
http: IHttp,
persistence: IPersistence,
modify: IModify
): Promise<IUIKitResponse> {
const {
buttonContext,
actionId,
triggerId,
user,
room,
message,
} = context.getInteractionData();
// If you have multiple action buttons, use `actionId` to determine
// which one the user interacted with
const blockBuilder = modify.getCreator().getBlockBuilder();
return context.getInteractionResponder().openModalViewResponse({
title: blockBuilder.newPlainTextObject('Interaction received'),
blocks: blockBuilder.addSectionBlock({
text: blockBuilder.newPlainTextObject('We received your interaction, thanks!')
}).getBlocks(),
});
return context.getInteractionResponder().successResponse();
}
}
how i can do it now
The getBlockBuilder method is deprecated, with which I can now build blocks and display it in a modal window