You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
On a slash command, when i reply or aknowledge, with a premise ->then or ->done, the parameter of the function is always null, not as the sendMessage one which as got the new message object
To Reproduce
Steps to reproduce the behavior:
$bot->getDiscord()->listenCommand('dt', function (Interaction $interaction) {
global $bot;
$discord = $bot->getDiscord();
$msg = 'Bonjour DT !'.PHP_EOL;
$is_admin = false;
if($interaction->user->id == '127425489399840768') {
$is_admin = true;
$interaction->acknowledge()->then(
function (Interaction $interaction) {
echo 'ackT', PHP_EOL;
var_dump($interaction);
$interaction->sendFollowUpMessage(MessageBuilder::new()->setContent('go'), true);
},
function ($error) {
echo 'ackT', PHP_EOL;
var_dump($error);
}
)
->done(
function (Interaction $interaction) {
echo 'ackD', PHP_EOL;
var_dump($interaction);
$interaction->sendFollowUpMessage(MessageBuilder::new()->setContent('go'), true);
},
function ($error) {
echo 'ackD', PHP_EOL;
var_dump($error);
}
);
};
});
Expected behavior
having the parameter of $interaction->sendFollowUpMessage with the value of listenCommand('dt', function (Interaction $interaction) {
It's the same with the functino replyMessage
Additional context
Logs :
[2024-02-21T08:38:00.492972+00:00] DiscordPHP.DEBUG: http not checking {"waiting":0,"empty":true} []
ackD
object(TypeError)#4776 (7) {
["message":protected]=>
string(218) "{closure}(): Argument #1 ($interaction) must be of type Discord\Parts\Interactions\Interaction, null given, called in C:\PHP\www\include\discord\DiscordPHP-7.3.4\vendor\react\promise\src\FulfilledPromise.php on line 28"
["string":"Error":private]=>
string(0) ""
["code":protected]=>
int(0)
["file":protected]=>
string(47) "C:\PHP\www\bots\discord\swgoh\commands\test.php"
["line":protected]=>
int(25)
["trace":"Error":private]=>
array(40) {
[0]=>
The text was updated successfully, but these errors were encountered:
Environment
[2024-02-21T08:37:56.323915+00:00] DiscordPHP.DEBUG: Initializing DiscordPHP v7.3.5 (DiscordPHP-Http: v9.1.9 & Gateway: v9) on PHP 8.0.30
Describe the bug
On a slash command, when i reply or aknowledge, with a premise ->then or ->done, the parameter of the function is always null, not as the sendMessage one which as got the new message object
To Reproduce
Steps to reproduce the behavior:
$bot->getDiscord()->listenCommand('dt', function (Interaction $interaction) {
global $bot;
$discord = $bot->getDiscord();
$msg = 'Bonjour DT !'.PHP_EOL;
$is_admin = false;
if($interaction->user->id == '127425489399840768') {
$is_admin = true;
$interaction->acknowledge()->then(
function (Interaction $interaction) {
echo 'ackT', PHP_EOL;
var_dump($interaction);
$interaction->sendFollowUpMessage(MessageBuilder::new()->setContent('go'), true);
},
function ($error) {
echo 'ackT', PHP_EOL;
var_dump($error);
}
)
->done(
function (Interaction $interaction) {
echo 'ackD', PHP_EOL;
var_dump($interaction);
$interaction->sendFollowUpMessage(MessageBuilder::new()->setContent('go'), true);
},
function ($error) {
echo 'ackD', PHP_EOL;
var_dump($error);
}
);
};
});
Expected behavior
having the parameter of $interaction->sendFollowUpMessage with the value of listenCommand('dt', function (Interaction $interaction) {
It's the same with the functino replyMessage
Additional context
Logs :
[2024-02-21T08:38:00.492972+00:00] DiscordPHP.DEBUG: http not checking {"waiting":0,"empty":true} []
ackD
object(TypeError)#4776 (7) {
["message":protected]=>
string(218) "{closure}(): Argument #1 ($interaction) must be of type Discord\Parts\Interactions\Interaction, null given, called in C:\PHP\www\include\discord\DiscordPHP-7.3.4\vendor\react\promise\src\FulfilledPromise.php on line 28"
["string":"Error":private]=>
string(0) ""
["code":protected]=>
int(0)
["file":protected]=>
string(47) "C:\PHP\www\bots\discord\swgoh\commands\test.php"
["line":protected]=>
int(25)
["trace":"Error":private]=>
array(40) {
[0]=>
The text was updated successfully, but these errors were encountered: