My function doesn't execute
DakioCode opened this issue · 3 comments
DakioCode commented
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....
Frago9876543210 commented
Can you provide minimal example?
DakioCode commented
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 commented
Can you help me?