forms icon indicating copy to clipboard operation
forms copied to clipboard

My function doesn't execute

Open DakioCode opened this issue 1 year ago • 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....

DakioCode avatar May 17 '24 06:05 DakioCode

Can you provide minimal example?

Frago9876543210 avatar May 17 '24 15:05 Frago9876543210

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...

DakioCode avatar May 17 '24 20:05 DakioCode

Can you help me?

DakioCode avatar May 17 '24 20:05 DakioCode