Configure the Client using Options
masterThe NewClient function accepts variadic Option arguments to customize the client. Use the following functions to configure your instance:
WithExtraGenerator(extraGenerator ExtraGenerator): Sets a custom generator for request extra IDs.WithFallbackTimeout(timeout time.Duration): Sets the maximum time the client will wait for a response before returning a timeout error if the provided context is still active.WithProxy(req *AddProxyRequest): Configures a proxy for the client connection.WithResultHandler(resultHandler ResultHandler): Sets a custom handler for all incoming updates/results.
client, err := client.NewClient(
authHandler,
client.WithFallbackTimeout(60 * time.Second),
client.WithResultHandler(myResultHandler),
)