Replies: 1 comment 2 replies
-
$discord->getLoop()->addPeriodicTimer(float seconds, function ($timer) { your code }); |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, professionals.
I have created new simple test code for alerts and then, I am not sure how can I implement the alert for every minute or hour.
This is my snipped code.
// Register Command
$discord->application->commands->save($discord->application->commands->create(CommandBuilder::new()
->setName("testalert")
->setDescription("Test alert")
->toArray()
));
// Listen Command
$discord->listenCommand("testalert", function (Interaction $interaction) {
$interaction->acknowledgeWithResponse()->done(function($interaction){
$interaction->updateOriginalResponse(MessageBuilder::new()->setContent('test'));
});
});
I am not sure how to respond the user command every hour or day because of discord api timeout is even 3s.
I would like to get provided the solution from discordPHP professionals and fans.
Regards.
Beta Was this translation helpful? Give feedback.
All reactions