Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The getBlockBuilder method is deprecated #752

Open
vorontsoved opened this issue Apr 10, 2024 · 1 comment
Open

The getBlockBuilder method is deprecated #752

vorontsoved opened this issue Apr 10, 2024 · 1 comment

Comments

@vorontsoved
Copy link

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

@vorontsoved
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant