RevoltSharp
  • 🏠Info
  • GitHub
  • 📋Changelog
  • Commands
    • 💻Command Handler
      • 📋Changelog
      • Guide
  • Guides
    • 📘Guides
      • Create Client
      • User Account
      • Self-hosted Revolt
      • Uploading Files
      • Sending Embeds
      • Async Events
      • Custom Requests
      • Cloudflare Under Attack Mode
  • Client Structure
    • ⚙️RevoltClient
    • 🌐Rest Client
    • 🔌Websocket Client
    • 🛡️Instance Admin Client
    • ⚡Events
    • ⛓️Extensions
  • Class Structure
    • 🎭Users & Members
    • 🏨Servers
    • #️⃣Channels
    • 🛡️Permissions
    • 💬Messages
    • 🗯️Message Properties
    • 🙂Emojis
    • 🎲Misc
Powered by GitBook
On this page
  1. Guides
  2. Guides

Create Client

Getting started with using RevoltSharp lib!

PreviousGuidesNextUser Account

Last updated 2 months ago

You need to download this lib from NuGet

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
}
📘
https://www.nuget.org/packages/RevoltSharp