Buttons with URLs

Hi all,

I hope someone can help me.
I am trying to build a rocket chat app that has a button. When you click that button, it opens a new window to a URL.

I have looked at the developer documentation and found that the button already has a URL property:

There is a * by the URL property, but it doesn’t say what the * is for (i.e. there is no other * on the page).
Here is my code as it stands:

export class RmgExperienceAppCommand implements ISlashCommand {
    public command = "video";
    public i18nDescription = "Sends a video call link to the shopper";
    public i18nParamsExample = "";
    public providesPreview = false;

    constructor(private commandHelper: ICommandHelper) {}

    public async executor(
        context: SlashCommandContext,
        read: IRead,
        modify: IModify,
        http: IHttp
    ): Promise<void> {
        const creator = modify.getCreator();
        const messageStructure = creator.startMessage();
        const sender = context.getSender(); // the user calling the slashcommand
        const room = context.getRoom() as any; // the current room
        const brand = await read
            .getEnvironmentReader()
            .getSettings()
            .getValueById(AppSetting.RmgBrand);

        let message = "";

        const { id: rocketChatRoomId } = room;
        const { username: visitorUsername, token: visitorToken } = room.visitor;
        const { username: agentName } = sender;

        const experienceAppUrl: Record<string, any> =
            await this.commandHelper.getExperienceAppUrl(
                brand,
                visitorUsername,
                visitorToken,
                agentName,
                rocketChatRoomId
            );

        if (experienceAppUrl.error) {
            message = experienceAppUrl.error;
        } else {
            const blockBuilder = creator.getBlockBuilder();

            blockBuilder.addActionsBlock({
                blockId: "video-call",
                appId: "experience-app",
                elements: [
                    blockBuilder.newButtonElement({
                        actionId: "join-call",
                        text: blockBuilder.newPlainTextObject("Join Call"),
                        style: ButtonStyle.PRIMARY,
                        url: `${experienceAppUrl.data}?agent=1`,
                    }),
                ],
            });
            messageStructure.setBlocks(blockBuilder);
        }

        messageStructure.setSender(sender).setRoom(room).setText(message);

        await creator.finish(messageStructure);
    }

I hoped that would work, but unfortunately it doesn’t do anything (when I type /video no message is presented to the agent or customer)

Any help would be appreciated

You need to register this command under " extendConfiguration" you can refer Sub-command pattern - Rocket.Chat Developer

Do you have an example, both them links I have tried before and they do not mention opening URLs/Links

@tiny fishing

Oke. I got it. I will try it