• Defers the response to a Discord interaction, indicating that a future response will be sent.

    Parameters

    • token: string

      The token used for authentication with the Discord API.

    • interactionId: string

      The ID of the interaction to defer.

    • interactionToken: string

      The token of the interaction to defer.

    • Optional content: string

      Optional content to include in the deferred response. Defaults to 'Processing...'.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating whether the defer operation was successful.

    Throws

    Will throw an error if there is a problem deferring the response.

    Example

    const token = 'your_discord_token_here';
    const interactionId = 'your_interaction_id_here';
    const interactionToken = 'your_interaction_token_here';
    const content = 'Please wait...';

    deferResponse(token, interactionId, interactionToken, content)
    .then(success => {
    if (success) {
    console.log('Response deferred successfully.');
    } else {
    console.log('Failed to defer the response.');
    }
    })
    .catch(error => console.error(`Error: ${error.message}`));

Generated using TypeDoc