Table of Contents

Method ConnectAsync

Namespace
DSharpPlus
Assembly
DSharpPlus.dll

ConnectAsync(DiscordActivity, DiscordUserStatus?, DateTimeOffset?)

Connects to the gateway

public Task ConnectAsync(DiscordActivity activity = null, DiscordUserStatus? status = null, DateTimeOffset? idlesince = null)

Parameters

activity DiscordActivity
status DiscordUserStatus?
idlesince DateTimeOffset?

Returns

Task

Exceptions

UnauthorizedException

Thrown when an invalid token was provided.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.