Create Client

Getting started with using RevoltSharp lib!

You need to download this lib from NuGet https://www.nuget.org/packages/RevoltSharp

You can use Visual Studio or Visual Studio Code

static void Main(string[] args)
{
    Start().GetAwaiter().GetResult();
}

public static RevoltClient Client;
public static async Task Start()
{
    Client = new RevoltClient(ClientMode.WebSocket);
    await Client.LoginAsync(Token, AccountType.Bot);
    // You don't need to run StartAsync for Http mode only WebSocket mode.
    await Client.StartAsync();
    await Task.Delay(-1);
}
public enum ClientMode
{
    /// <summary>
    /// Client will only use the http/rest client of Revolt and removes any usage/memory of websocket stuff. 
    /// </summary>
    Http, 
    
    /// <summary>
    /// Will use both WebSocket and http/rest client so you can get cached data for User, Server, Channel
    /// </summary>
    WebSocket
}

Last updated