Class ServerlessDiscordLambdaRouter

Serverless Discord Router for AWS Lambda

This class is responsible for handling the AWS Lambda event and converting it into a DiscordInteraction. This is then passed to the ServerlessDiscordRouter to handle the interaction.

This class also handles async application commands. These are commands that are not expected to return a response immediately. The async handler should be run as a seperate Lambda function. This function will be called with the interaction data as the event.

Hierarchy

Constructors

Properties

apiClient?: DiscordApiClient
applicationId: string
authHandler?: AuthHandler
commands: Command[]
logHandler: Logger<LoggerOptions>
queueUrl?: string
sqsClient?: SQSClient

Methods

  • Handler for AWS Lambda behind API Gateway that handles Discord bot interactions

    Returns

    APIGatewayProxyResult

    Parameters

    • event: APIGatewayProxyEvent

      APIGatewayEvent from AWS Lambda

    Returns Promise<APIGatewayProxyResult>

  • Handles an SQS event that contains Discord interactions

    Parameters

    • event: SQSEvent

    Returns Promise<void>

Generated using TypeDoc