Skip to content

Commit

Permalink
Static function
Browse files Browse the repository at this point in the history
  • Loading branch information
valzargaming committed Jan 15, 2025
1 parent 4731da6 commit f5c84ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Discord/Builders/Components/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public function setListener(?callable $callback, Discord $discord, bool $oneOff
$this->listener = function (Interaction $interaction) use ($callback, $oneOff) {
if ($interaction->data->component_type == Component::TYPE_BUTTON && $interaction->data->custom_id == $this->custom_id) {
$response = $callback($interaction);
$ack = fn() => $interaction->isResponded() ?: $interaction->acknowledge();
$ack = static fn() => $interaction->isResponded() ?: $interaction->acknowledge();

if ($response instanceof PromiseInterface) {
$response->then($ack);
Expand Down
2 changes: 1 addition & 1 deletion src/Discord/Builders/Components/SelectMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ public function setListener(?callable $callback, Discord $discord, bool $oneOff

$response = $callback($interaction, $options);
}
$ack = fn() => $interaction->isResponded() ?: $interaction->acknowledge();
$ack = static fn() => $interaction->isResponded() ?: $interaction->acknowledge();

if ($response instanceof PromiseInterface) {
$response->then($ack);
Expand Down

0 comments on commit f5c84ab

Please sign in to comment.