Webhooks Module

Module for processing webhook based actions.

class action_triggers.webhooks.WebhookProcessor(webhook: Webhook, payload: str | dict)[source]

Bases: object

Process an action which involves sending a webhook.

Parameters:
  • webhook – The webhook configuration to process.

  • payload – The payload to send with the webhook.

get_fn_kwargs() dict[source]

Returns the keyword arguments to pass to the request function.

Returns:

The keyword arguments to pass to the request function.

get_headers() dict[source]

Returns the headers to use for the webhook.

Returns:

The headers to use for the webhook.

Return type:

dict

get_request_fn(session: ClientSession) Callable[[...], ClientResponse][source]

Returns the function to use for the webhook.

Raises:

AttributeError – If the HTTP method is not supported.

Returns:

The request function to use for the webhook.

async process() ClientResponse[source]

Processes the webhook action.