Frago9876543210/forms

My function doesn't execute

DakioCode opened this issue · 3 comments

Hello 👋, when I send a MenuForm and I click on a button, the functions in the 4th and 5th arguments in the constructor ($onOpen and $onClose) don't execute....

Can you provide minimal example?

Yes, for exemple :

<?php

parent::__construct(
    "Gestion de la demande de combat",
    "Cliquez sur un bouton ci-dessous : \n\t§tJoueur adverse : §f" . $name,
    [
        new Button("§aAccepter"),
        new Button("§cRefuser"),
    ],
    fn (Player $player, Button $selected) => $player->sendMessage($selected->text), 👈
    fn (Player $player) => $player->sendMessage("On Close") 👈
);

When I click on any button or I close the form, I don't receive any messages...

Can you help me?