Skip to main content

Class RevoltClient

Assembly: Revolt.Net.dll​
View Source​
Declaration
public class RevoltClient

Properties​

ApiInfo​

View Source​
Declaration
public RevoltApiInfo ApiInfo { get; }

AutumnInfo​

View Source​
Declaration
public AutumnInformation AutumnInfo { get; }

State​

View Source​
Declaration
public RevoltClientState State { get; }

UsersCache​

View Source​
Declaration
public IReadOnlyCollection<User> UsersCache { get; }

ChannelsCache​

View Source​
Declaration
public IReadOnlyCollection<Channel> ChannelsCache { get; }

ServersCache​

View Source​
Declaration
public IReadOnlyCollection<Server> ServersCache { get; }

ApiUrl​

Url for the Revolt Api server, known as Delta.

View Source​
Declaration
public string ApiUrl { get; }

AutumnUrl​

Url for the Revolt CDN, known as Autumn.

View Source​
Declaration
public string AutumnUrl { get; }

VortexUrl​

Url for the Revolt voice server, known as Vortex.

View Source​
Declaration
public string VortexUrl { get; }

Channels​

View Source​
Declaration
public RevoltClientChannels Channels { get; }

Users​

View Source​
Declaration
public RevoltClientUsers Users { get; }

Self​

View Source​
Declaration
public RevoltClientSelf Self { get; }

Servers​

View Source​
Declaration
public RevoltClientServers Servers { get; }

Bots​

View Source​
Declaration
public RevoltRestClientBots Bots { get; }

Invites​

View Source​
Declaration
public RevoltRestClientInvites Invites { get; }

TokenType​

View Source​
Declaration
public TokenType TokenType { get; }

User​

The logged in user.

View Source​
Declaration
public User User { get; }

WebSocketPing​

The WebSocket ping in milliseconds, refreshed around every 30 seconds

View Source​
Declaration
public long WebSocketPing { get; }

Fields​

DefaultApiUrl​

View Source​
Declaration
public const string DefaultApiUrl = "https://api.revolt.chat/"

Methods​

LoginAsync(TokenType, String)​

Log in with an existing token and finish initialization of the client.

View Source​
Declaration
public async Task LoginAsync(TokenType tokenType, string token)
Returns​

System.Threading.Tasks.Task

Parameters​
TypeNameDescription
Revolt.TokenTypetokenType
System.StringtokenUser or bot token.

LoginAsync(String, String, String, String, String)​

Creates a session and automatically uses it.

View Source​
Declaration
public async Task<Session> LoginAsync(string email, string password, string challenge = null, string friendlyName = null, string captcha = null)
Returns​

System.Threading.Tasks.Task<Revolt.Session>: The session that was created.

Parameters​
TypeName
System.Stringemail
System.Stringpassword
System.Stringchallenge
System.StringfriendlyName
System.Stringcaptcha

UploadFile(String, String, String)​

View Source​
Declaration
public async Task<string> UploadFile(string name, string path, string tag = "attachments")
Returns​

System.Threading.Tasks.Task<System.String>

Parameters​
TypeName
System.Stringname
System.Stringpath
System.Stringtag

UploadFile(String, Byte[], String)​

View Source​
Declaration
public async Task<string> UploadFile(string name, byte[] data, string tag = "attachments")
Returns​

System.Threading.Tasks.Task<System.String>

Parameters​
TypeName
System.Stringname
System.Byte[]data
System.Stringtag

UpdateAvatarId(String)​

View Source​
Declaration
public Task<IRestResponse> UpdateAvatarId(string id)
Returns​

System.Threading.Tasks.Task<RestSharp.IRestResponse>

Parameters​
TypeName
System.Stringid

GetVortexInfoAsync()​

View Source​
Declaration
public Task<VortexInformation> GetVortexInfoAsync()
Returns​

System.Threading.Tasks.Task<Revolt.VortexInformation>

GetAutumnInfoAsync()​

View Source​
Declaration
public Task<AutumnInformation> GetAutumnInfoAsync()
Returns​

System.Threading.Tasks.Task<Revolt.AutumnInformation>

GetApiInfoAsync()​

View Source​
Declaration
public Task<RevoltApiInfo> GetApiInfoAsync()
Returns​

System.Threading.Tasks.Task<Revolt.RevoltApiInfo>

GenerateNonce()​

View Source​
Declaration
public static string GenerateNonce()
Returns​

System.String

CacheAll()​

Cache all server members.

View Source​
Declaration
public async Task CacheAll()
Returns​

System.Threading.Tasks.Task

ConnectWebSocketAsync()​

Connects the client to the websocket.

View Source​
Declaration
public async Task ConnectWebSocketAsync()
Returns​

System.Threading.Tasks.Task

DisconnectWebsocket()​

View Source​
Declaration
public void DisconnectWebsocket()

Events​

MessageReceived​

View Source​
Declaration
public event Func<Message, Task> MessageReceived
Event Type​

System.Func<Revolt.Message,System.Threading.Tasks.Task>

SystemMessageReceived​

View Source​
Declaration
public event Func<ObjectMessage, Task> SystemMessageReceived
Event Type​

System.Func<Revolt.ObjectMessage,System.Threading.Tasks.Task>

OnReady​

View Source​
Declaration
public event Func<Task> OnReady
Event Type​

System.Func<System.Threading.Tasks.Task>

OnWebSocketPong​

When WebSocket ping is updated, around every 30 seconds.

View Source​
Declaration
public event Func<Task> OnWebSocketPong
Event Type​

System.Func<System.Threading.Tasks.Task>

MessageDeleted​

View Source​
Declaration
public event Func<string, Task> MessageDeleted
Event Type​

System.Func<System.String,System.Threading.Tasks.Task>

UserRelationshipUpdated​

View Source​
Declaration
public event Func<string, RelationshipStatus, Task> UserRelationshipUpdated
Event Type​

System.Func<System.String,Revolt.RelationshipStatus,System.Threading.Tasks.Task>

MessageUpdated​

View Source​
Declaration
public event Func<string, MessageEditData, Task> MessageUpdated
Event Type​

System.Func<System.String,Revolt.MessageEditData,System.Threading.Tasks.Task>

PacketReceived​

Raised before a packet is handled. Ran asynchronously/not awaited.

View Source​
Declaration
public event Func<string, JObject, ResponseMessage, Task> PacketReceived
Event Type​

System.Func<System.String,Newtonsoft.Json.Linq.JObject,Websocket.Client.ResponseMessage,System.Threading.Tasks.Task>

PacketError​

Invoked when an exception occurs when handling a websocket packet.

View Source​
Declaration
public event Func<string, JObject, ResponseMessage, Exception, Task> PacketError
Event Type​

System.Func<System.String,Newtonsoft.Json.Linq.JObject,Websocket.Client.ResponseMessage,System.Exception,System.Threading.Tasks.Task>

ChannelCreate​

View Source​
Declaration
public event Func<Channel, Task> ChannelCreate
Event Type​

System.Func<Revolt.Channels.Channel,System.Threading.Tasks.Task>

ChannelGroupJoin​

GroupId, UserId

View Source​
Declaration
public event Func<string, string, Task> ChannelGroupJoin
Event Type​

System.Func<System.String,System.String,System.Threading.Tasks.Task>

ChannelGroupLeave​

GroupId, UserId

View Source​
Declaration
public event Func<string, string, Task> ChannelGroupLeave
Event Type​

System.Func<System.String,System.String,System.Threading.Tasks.Task>

ChannelDelete​

View Source​
Declaration
public event Func<string, Task> ChannelDelete
Event Type​

System.Func<System.String,System.Threading.Tasks.Task>

UserPresence​

UserId, Online

View Source​
Declaration
public event Func<string, bool, Task> UserPresence
Event Type​

System.Func<System.String,System.Boolean,System.Threading.Tasks.Task>

ChannelUpdate​

View Source​
Declaration
public event Func<string, JObject, Task> ChannelUpdate
Event Type​

System.Func<System.String,Newtonsoft.Json.Linq.JObject,System.Threading.Tasks.Task>

Disconnected​

View Source​
Declaration
public event Func<DisconnectionInfo, Task> Disconnected
Event Type​

System.Func<Websocket.Client.DisconnectionInfo,System.Threading.Tasks.Task>

Reconnected​

View Source​
Declaration
public event Func<ReconnectionInfo, Task> Reconnected
Event Type​

System.Func<Websocket.Client.Models.ReconnectionInfo,System.Threading.Tasks.Task>

ServerDeleted​

View Source​
Declaration
public event Func<Server, Task> ServerDeleted
Event Type​

System.Func<Revolt.Server,System.Threading.Tasks.Task>

ServerMemberUpdated​

View Source​
Declaration
public event Func<Member, Member, Task> ServerMemberUpdated
Event Type​

System.Func<Revolt.Member,Revolt.Member,System.Threading.Tasks.Task>

ServerMemberLeave​

View Source​
Declaration
public event Func<string, string, Task> ServerMemberLeave
Event Type​

System.Func<System.String,System.String,System.Threading.Tasks.Task>

ServerMemberJoin​

View Source​
Declaration
public event Func<string, string, Task> ServerMemberJoin
Event Type​

System.Func<System.String,System.String,System.Threading.Tasks.Task>

ServerRoleDeleted​

View Source​
Declaration
public event Func<Server, Role, Task> ServerRoleDeleted
Event Type​

System.Func<Revolt.Server,Revolt.Role,System.Threading.Tasks.Task>

ServerRoleUpdated​

Server, Role Id, Old Role, New Role

View Source​
Declaration
public event Func<Server, string, Role, Role, Task> ServerRoleUpdated
Event Type​

System.Func<Revolt.Server,System.String,Revolt.Role,Revolt.Role,System.Threading.Tasks.Task>