# Events

{% hint style="info" %}
All events require WebSocket mode except for OnStarted which can be used in Http mode.
{% endhint %}

### Client

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>OnStarted</strong></td><td>The client has connected to the API and will give a <a href="../../class-structure/users-and-members#selfuser"><mark style="color:purple;">SelfUser</mark></a> object.</td><td>This can be used in Http mode.</td><td></td></tr></tbody></table>

<table data-view="cards" data-full-width="false"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>OnConnected</strong></td><td>The client has successfully connected to Revolt.</td><td></td></tr><tr><td><strong>OnReady</strong></td><td>The client is ready to use and will give a <a href="../../class-structure/users-and-members#selfuser"><mark style="color:purple;">SelfUser</mark></a> object with the logged in user/bot account to use.</td><td></td></tr><tr><td><strong>OnWebSocketError</strong></td><td>The client has encountered an issue and will give a <a href="../revoltclient#revoltclient"><mark style="color:purple;">RevoltClient</mark></a> and <a href="../websocket-client#socketerror"><mark style="color:purple;">SocketError</mark></a> object with the specific error data.</td><td></td></tr><tr><td><strong>OnUserUpdated</strong></td><td>A cached user has been updated with new properties and will give an old <a href="../../class-structure/users-and-members#user"><mark style="color:purple;">User</mark></a> object and new <a href="../../class-structure/users-and-members#user"><mark style="color:purple;">User</mark></a> object to compare.</td><td></td></tr><tr><td><strong>OnCurrentUserUpdated</strong></td><td>The client user/bot has been updated with new properties and will give an old <a href="../../class-structure/users-and-members#selfuser"><mark style="color:purple;">SelfUser</mark></a> object and new <a href="../../class-structure/users-and-members#selfuser"><mark style="color:purple;">SelfUser</mark></a> object to compare.</td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

{% hint style="info" %}
A <mark style="color:purple;">Downloadable<></mark> object can be used to get the Id of the specific object like User/Channel/Message and you can use the GetOrDownloadAsync() method to get the object from cache or fetch from the Revolt API if it's still available.
{% endhint %}

### Messages

<table data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>OnMessageRecieved</strong></td><td>A message has been sent from a user and will give a <a href="../../class-structure/messages#message"><mark style="color:purple;">Message</mark></a> object for content, author and other properties to use.</td><td></td></tr><tr><td><strong>OnMessageUpdated</strong></td><td>A message has been updated and will give a <mark style="color:purple;">Downloadable</mark>&#x3C;<mark style="color:yellow;">string</mark>, <a href="../../class-structure/messages#message"><mark style="color:purple;">Message</mark></a>> and  <a href="../../class-structure/messages#messageupdatedproperties"><mark style="color:purple;">MessageUpdatedProperties</mark></a> with the properties that have been updated and <mark style="color:yellow;">Message id</mark>.</td><td></td></tr><tr><td><strong>OnMessageDeleted</strong></td><td>A message has been deleted and will give a <a href="../../class-structure/channels#channel"><mark style="color:purple;">Channel</mark></a> object and <mark style="color:yellow;">Message id</mark> string of the deleted message.</td><td></td></tr><tr><td><strong>OnMessagesBulkDeleted</strong></td><td>Multiple messages have been deleted and will give a <a href="../../class-structure/channels#channel"><mark style="color:purple;">Channel</mark></a> object and <mark style="color:yellow;">Message id</mark>[ ] list of the deleted messages.</td><td></td></tr></tbody></table>

### Reactions

<table data-view="cards" data-full-width="false"><thead><tr><th align="center"></th><th></th><th></th></tr></thead><tbody><tr><td align="center"><strong>OnReactionAdded</strong></td><td>A reaction has been added to a message and will give a <a href="../../class-structure/emojis#emoji"><mark style="color:purple;">Emoji</mark></a> object <a href="../../class-structure/channels#serverchannel"><mark style="color:purple;">ServerChannel</mark></a> object <mark style="color:purple;">Downloadable</mark>&#x3C;<mark style="color:yellow;">string</mark>, <a href="../../class-structure/users-and-members#servermember"><mark style="color:purple;">ServerMember</mark></a>> object and <mark style="color:purple;">Downloadable</mark>&#x3C;<mark style="color:yellow;">string</mark>, <a href="../../class-structure/messages#message"><mark style="color:purple;">Message</mark></a>> object.</td><td></td></tr><tr><td align="center"><strong>OnReactionRemoved</strong></td><td>A reaction has been removed from a message and will give a <a href="../../class-structure/emojis#emoji"><mark style="color:purple;">Emoji</mark></a> object <a href="../../class-structure/channels#serverchannel"><mark style="color:purple;">ServerChannel</mark></a> object <mark style="color:purple;">Downloadable</mark>&#x3C;<mark style="color:yellow;">string</mark>, <a href="../../class-structure/users-and-members#servermember"><mark style="color:purple;">ServerMember</mark></a>> object and <mark style="color:purple;">Downloadable</mark>&#x3C;<mark style="color:yellow;">string</mark>, <a href="../../class-structure/messages#message"><mark style="color:purple;">Message</mark></a>> object.</td><td></td></tr><tr><td align="center"><strong>OnReactionBulkRemoved</strong></td><td>All reactions for a specific emoji have been removed from a message and will give a <a href="../../class-structure/emojis#emoji"><mark style="color:purple;">Emoji</mark></a> object, <a href="../../class-structure/channels#channel"><mark style="color:purple;">Channel</mark></a> object and <mark style="color:purple;">Downloadable</mark>&#x3C;<mark style="color:yellow;">string</mark>, <a href="../../class-structure/messages#message"><mark style="color:purple;">Message</mark></a>> object.</td><td></td></tr></tbody></table>

### Channels

<table data-view="cards"><thead><tr><th align="center"></th><th></th><th></th></tr></thead><tbody><tr><td align="center"><strong>OnChannelCreated</strong></td><td>A server channel has been created and will give a <a href="../../class-structure/channels#serverchannel"><mark style="color:purple;">ServerChannel</mark></a> object.</td><td></td></tr><tr><td align="center"><strong>OnChannelUpdated</strong></td><td>A cached channel has been updated with new properties and will give an old <a href="../../class-structure/channels#channel"><mark style="color:purple;">Channel</mark></a> object, new <a href="../../class-structure/channels#channel"><mark style="color:purple;">Channel</mark></a> object and <a href="../../class-structure/channels#channelupdatedproperties"><mark style="color:purple;">ChannelUpdatedProperties</mark></a></td><td></td></tr><tr><td align="center"><strong>OnChannelDeleted</strong></td><td>A channel has been deleted and will give a <a href="../../class-structure/channels#channel"><mark style="color:purple;">Channel</mark></a> object.</td><td></td></tr></tbody></table>

### Groups

<table data-view="cards"><thead><tr><th align="center"></th><th></th><th></th></tr></thead><tbody><tr><td align="center"><strong>OnGroupJoined</strong></td><td>The current user/bot account has joined a group channel and will give a <a href="../../class-structure/channels#groupchannel"><mark style="color:purple;">GroupChannel</mark></a> object and <a href="../../class-structure/users-and-members#selfuser"><mark style="color:purple;">SelfUser</mark></a> object.</td><td></td></tr><tr><td align="center"><strong>OnGroupLeft</strong></td><td>The current user/bot account has left a group channel and will give a <a href="../../class-structure/channels#groupchannel"><mark style="color:purple;">GroupChannel</mark></a> object and <a href="../../class-structure/users-and-members#selfuser"><mark style="color:purple;">SelfUser</mark></a> object.</td><td></td></tr><tr><td align="center"></td><td></td><td></td></tr><tr><td align="center"><strong>OnGroupUserJoined</strong></td><td>A user has joined a group channel and will give a <a href="../../class-structure/channels#groupchannel"><mark style="color:purple;">GroupChannel</mark></a> object and <a href="../../class-structure/users-and-members#user"><mark style="color:purple;">User</mark></a> object.</td><td></td></tr><tr><td align="center"><strong>OnGroupUserLeft</strong></td><td>A user has left a group channel and will give a <a href="../../class-structure/channels#groupchannel"><mark style="color:purple;">GroupChannel</mark></a> object and <a href="../../class-structure/users-and-members#user"><mark style="color:purple;">User</mark></a> object.</td><td></td></tr></tbody></table>

### DMs

<table data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>OnDMChannelOpened</strong></td><td>A private channel between another user has been opened or become active again and will give a <a href="../../class-structure/channels#dmchannel"><mark style="color:purple;">DMChannel</mark></a> object.</td><td></td></tr></tbody></table>

### Servers

<table data-view="cards"><thead><tr><th align="center"></th><th></th><th></th></tr></thead><tbody><tr><td align="center"><strong>OnServerJoined</strong></td><td>The current user/bot has joined a server and will give a <a href="../../class-structure/servers#server"><mark style="color:purple;">Server</mark></a> object and <a href="../../class-structure/users-and-members#selfuser"><mark style="color:purple;">SelfUser</mark></a> object.</td><td></td></tr><tr><td align="center"><strong>OnServerLeft</strong></td><td>The current user/bot has left a server and will give a <a href="../../class-structure/servers#server"><mark style="color:purple;">Server</mark></a> object and <a href="../../class-structure/users-and-members#selfuser"><mark style="color:purple;">SelfUser</mark></a> object.</td><td></td></tr><tr><td align="center"></td><td></td><td></td></tr></tbody></table>

<table data-view="cards"><thead><tr><th align="center"></th><th></th><th></th></tr></thead><tbody><tr><td align="center"><strong>OnServerUpdated</strong></td><td>A cached Server has been updated with new properties and will give an old <a href="../../class-structure/servers#server"><mark style="color:purple;">Server</mark></a> object, new <a href="../../class-structure/servers#server"><mark style="color:purple;">Server</mark></a> object to compare and <a href="../../class-structure/servers#server-updated-properties"><mark style="color:purple;">ServerUpdatedProperties</mark></a> object.</td><td></td></tr><tr><td align="center"><strong>OnMemberJoined</strong></td><td>A user has joined a server and will give a <a href="../../class-structure/servers#server"><mark style="color:purple;">Server</mark></a> object and <a href="../../class-structure/users-and-members#servermember"><mark style="color:purple;">ServerMember</mark></a> object.</td><td></td></tr><tr><td align="center"><strong>OnMemberLeft</strong></td><td>A user has left a server and will give a <a href="../../class-structure/servers#server"><mark style="color:purple;">Server</mark></a> object and <a href="../../class-structure/users-and-members#servermember"><mark style="color:purple;">ServerMember</mark></a> object.</td><td></td></tr><tr><td align="center"><strong>OnRoleCreated</strong></td><td>A new role has been created on a server and will give a <a href="../../class-structure/servers#role"><mark style="color:purple;">Role</mark></a> object.</td><td></td></tr><tr><td align="center"><strong>OnRoleUpdated</strong></td><td>A role has been updated with new properties in a server and will give an old <a href="../../class-structure/servers#role"><mark style="color:purple;">Role</mark></a> object, new <a href="../../class-structure/servers#role"><mark style="color:purple;">Role</mark></a> object and <a href="../../class-structure/servers#role-updated-properties"><mark style="color:purple;">RoleUpdatedProperties</mark></a> object.</td><td></td></tr><tr><td align="center"><strong>OnRoleDeleted</strong></td><td>A role has been deleted from a server and will give a <a href="../../class-structure/servers#role"><mark style="color:purple;">Role</mark></a> object.</td><td></td></tr><tr><td align="center"><strong>OnEmojiCreated</strong></td><td>A new emoji has been created on a server and will give a <a href="../../class-structure/servers#server"><mark style="color:purple;">Server</mark></a> object and <a href="../../class-structure/emojis#emoji"><mark style="color:purple;">Emoji</mark></a> object.</td><td></td></tr><tr><td align="center"><strong>OnEmojiDeleted</strong></td><td>A emoji has been deleted from a server and will give a <a href="../../class-structure/servers#server"><mark style="color:purple;">Server</mark></a> object and <a href="../../class-structure/emojis#emoji"><mark style="color:purple;">Emoji</mark> </a>object.</td><td></td></tr></tbody></table>
