Skip to content

SignalBotClientOptionsBuilder

Namespace: Signal.Bot

Full Name: Signal.Bot.SignalBotClientOptionsBuilder

Summary

Provides a fluent interface for constructing SignalBotClientOptions with validation.

Methods

Create

csharp
Create()

Creates a new instance of the SignalBotClientOptionsBuilder.

Returns: A new SignalBotClientOptionsBuilder instance.

WithBaseUrl

csharp
WithBaseUrl(baseUrl)

Sets the base URL of the Signal Bot API endpoint.

Parameters:

Returns: The builder instance for method chaining.

WithNumber

csharp
WithNumber(number)

Sets the Signal phone number associated with the bot.

Parameters:

  • number - The phone number in international format (e.g., "+1234567890").

Returns: The builder instance for method chaining.

WithHttpClient

csharp
WithHttpClient(httpClient)

Sets a custom HttpClient instance for API requests. If not provided, a default HttpClient will be created with the configured base URL.

Parameters:

  • httpClient - The HttpClient instance to use.

Returns: The builder instance for method chaining.

Build

csharp
Build()

Builds and validates the SignalBotClientOptions instance. Creates a default HttpClient if one was not provided.

Returns: The configured and validated SignalBotClientOptions instance.

Exceptions:

  • System.ArgumentException - Thrown when Number or BaseUrl is null or whitespace.

E164Regex

csharp
E164Regex()