Show / Hide Table of Contents

# Class SocketReaction

Represents a WebSocket-based reaction object.

##### Inheritance

System.Object
SocketReaction

##### Implements

IReaction

##### Inherited Members

System.Object.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()

###### Namespace: Discord.WebSocket

###### Assembly: Discord.Net.WebSocket.dll

##### Syntax

    public class SocketReaction : IReaction

### Properties

| Improve this Doc View Source

#### Channel

Gets the channel where the reaction takes place in.

##### Declaration

    public ISocketMessageChannel Channel { get; }

##### Property Value

Type | Description
--- | ---
ISocketMessageChannel | A WebSocket-based message channel.

| Improve this Doc View Source

#### Emote

The IEmote used in the reaction.

##### Declaration

    public IEmote Emote { get; }

##### Property Value

Type | Description
--- | ---
IEmote |

| Improve this Doc View Source

#### 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

Optional<T>
| Improve this Doc View Source

#### 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.

| Improve this Doc View Source

#### 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

Optional<T>
| Improve this Doc View Source

#### 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 Source

#### Equals(Object)

##### Declaration

    public override bool Equals(object other)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Object | other |

##### Returns

Type | Description
--- | ---
System.Boolean |

##### Overrides

System.Object.Equals(System.Object)
| Improve this Doc View Source

#### GetHashCode()

##### Declaration

    public override int GetHashCode()

##### Returns

Type | Description
--- | ---
System.Int32 |

##### Overrides

System.Object.GetHashCode()

### Implements

IReaction