Class SocketReaction
Represents a WebSocket-based reaction object.
Inheritance
Implements
Inherited Members
Namespace: Discord.WebSocket
Assembly: Discord.Net.WebSocket.dll
Syntax
public class SocketReaction : IReaction
Properties
| Improve this Doc View SourceChannel
Gets the channel where the reaction takes place in.
Declaration
public ISocketMessageChannel Channel { get; }
Property Value
| Type | Description |
|---|---|
| ISocketMessageChannel | A WebSocket-based message channel. |
Emote
The IEmote used in the reaction.
Declaration
public IEmote Emote { get; }
Property Value
| Type | Description |
|---|---|
| IEmote |
Message
Gets the message that has been reacted to if possible.
Declaration
public Optional<SocketUserMessage> Message { get; }
Property Value
| Type | Description |
|---|---|
| Optional<SocketUserMessage> | A WebSocket-based message where possible; a value is not always returned. |
See Also
MessageId
Gets the ID of the message that has been reacted to.
Declaration
public ulong MessageId { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt64 | A message snowflake identifier associated with the message. |
User
Gets the user who added the reaction if possible.
Declaration
public Optional<IUser> User { get; }
Property Value
| Type | Description |
|---|---|
| Optional<IUser> | A user object where possible; a value is not always returned. |
Remarks
This property attempts to retrieve a WebSocket-cached user that is responsible for this reaction from the client. In other words, when the user is not in the WebSocket cache, this property may not contain a value, leaving the only identifiable information to be UserId.
If you wish to obtain an identifiable user object, consider utilizing DiscordRestClient which will attempt to retrieve the user from REST.
See Also
UserId
Gets the ID of the user who added the reaction.
Declaration
public ulong UserId { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt64 | A user snowflake identifier associated with the user. |
Remarks
This property retrieves the snowflake identifier of the user responsible for this reaction. This property will always contain the user identifier in event that User cannot be retrieved.
Methods
| Improve this Doc View SourceEquals(Object)
Declaration
public override bool Equals(object other)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | other |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 |