Table of Contents

Class SocketReaction

Namespace
Discord.WebSocket
Assembly
Discord.Net.WebSocket.dll

Represents a WebSocket-based reaction object.

public class SocketReaction : IReaction
Inheritance
SocketReaction
Implements
Inherited Members

Properties

BurstColors

Gets colors used for the super reaction.

public IReadOnlyCollection<Color> BurstColors { get; }

Property Value

IReadOnlyCollection<Color>

Remarks

The collection will be empty if the reaction is a normal reaction.

Channel

Gets the channel where the reaction takes place in.

public ISocketMessageChannel Channel { get; }

Property Value

ISocketMessageChannel

A WebSocket-based message channel.

Emote

The IEmote used in the reaction.

public IEmote Emote { get; }

Property Value

IEmote

IsBurst

Gets whether the reaction is a super reaction.

public bool IsBurst { get; }

Property Value

bool

Message

Gets the message that has been reacted to if possible.

public Optional<SocketUserMessage> Message { get; }

Property Value

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.

public ulong MessageId { get; }

Property Value

ulong

A message snowflake identifier associated with the message.

ReactionType

Gets the type of the reaction.

public ReactionType ReactionType { get; }

Property Value

ReactionType

User

Gets the user who added the reaction if possible.

public Optional<IUser> User { get; }

Property Value

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.

public ulong UserId { get; }

Property Value

ulong

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

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object other)

Parameters

other object

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.