Class FluxerClient
Client used for connecting to the Fluxer API and Gateway.
public class FluxerClient : FluxerBaseClient
- Inheritance
-
objectFluxerClient
- Inherited Members
Constructors
FluxerClient(string, FluxerConfig?)
Create a Fluxer client.
public FluxerClient(string token, FluxerConfig? config = null)
Parameters
tokenstringconfigFluxerConfig
Properties
Gateway
Gateway client for Fluxer with events.
public FluxerGatewayClient Gateway { get; }
Property Value
Rest
Http client for Fluxer with requests.
public FluxerApiClient Rest { get; }
Property Value
Token
Token for the current user.
public string Token { get; }
Property Value
Methods
LoginAsync(string)
This will update your config urls to use the instance.
public Task<Instance> LoginAsync(string apiUrl = null)
Parameters
apiUrlstring
Returns
Exceptions
StartAsync()
Start the gateway session to recieve events.
public Task StartAsync()
Returns
UseCanary()
Use canary features for the API.
public FluxerClient UseCanary()
Returns
ValidateToken(string)
Validates that the token has a recognized prefix for the Fluxer API.
public static void ValidateToken(string token)
Parameters
tokenstringThe token to validate.
Exceptions
- ArgumentException
Thrown when the token is null, empty, or does not begin with a valid prefix. Bot tokens must start with
Bot(including the trailing space). User tokens must start withflx_.