Skip to content
This repository was archived by the owner on Nov 5, 2025. It is now read-only.
This repository was archived by the owner on Nov 5, 2025. It is now read-only.

The getBlockBuilder method is deprecated #752

Description

@vorontsoved

The getBlockBuilder method is deprecated, with which I can now build blocks and display it in a modal window

Activity

  1. vorontsoved commented on Apr 10, 2024

    @vorontsoved
    Author
    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions