Skip to content
Discussion options

You must be logged in to vote
$discord->application->commands->freshen()->then(function (GlobalCommandRepository $commands): void
{
    // if ($command = $commands->get('name', 'ping')) $commands->delete($command);
    if (! $commands->get('name', 'ping')) $commands->save(new Command($discord, [
        'name'        => 'ping',
        'description' => 'Replies with Pong!',
    ]));

    $discord->listenCommand('ping', fn (Interaction $interaction): PromiseInterface =>
        $interaction->respondWithMessage('Pong!', true)
    );
});

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@SQKo
Comment options

SQKo Dec 9, 2023
Maintainer

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by valzargaming
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants