Show / Hide Table of Contents

# Class SocketGuildUser

Represents a WebSocket-based guild user.

##### Inheritance

System.Object
SocketEntity<System.UInt64>
SocketUser
SocketGuildUser

##### Implements

IGuildUser
IUser
ISnowflakeEntity
IEntity<System.UInt64>
IMentionable
IPresence
IVoiceState

##### Inherited Members

SocketUser.CreatedAt
SocketUser.Discriminator
SocketUser.Mention
SocketUser.Activity
SocketUser.Status
SocketUser.ActiveClients
SocketUser.MutualGuilds
SocketUser.GetOrCreateDMChannelAsync(RequestOptions)
SocketUser.GetAvatarUrl(ImageFormat, UInt16)
SocketUser.GetDefaultAvatarUrl()
SocketUser.ToString()
SocketEntity<UInt64>.Id
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()

###### Namespace: Discord.WebSocket

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

##### Syntax

    public class SocketGuildUser : SocketUser, IGuildUser, IUser, ISnowflakeEntity, IEntity<ulong>, IMentionable, IPresence, IVoiceState

### Properties

| Improve this Doc View Source

#### AudioStream

##### Declaration

    public AudioInStream AudioStream { get; }

##### Property Value

Type | Description
--- | ---
AudioInStream |

| Improve this Doc View Source

#### AvatarId

##### Declaration

    public override string AvatarId { get; }

##### Property Value

Type | Description
--- | ---
System.String |

##### Overrides

SocketUser.AvatarId
| Improve this Doc View Source

#### DiscriminatorValue

##### Declaration

    public override ushort DiscriminatorValue { get; }

##### Property Value

Type | Description
--- | ---
System.UInt16 |

##### Overrides

SocketUser.DiscriminatorValue
| Improve this Doc View Source

#### Guild

Gets the guild the user is in.

##### Declaration

    public SocketGuild Guild { get; }

##### Property Value

Type | Description
--- | ---
SocketGuild |

| Improve this Doc View Source

#### GuildPermissions

##### Declaration

    public GuildPermissions GuildPermissions { get; }

##### Property Value

Type | Description
--- | ---
GuildPermissions |

| Improve this Doc View Source

#### Hierarchy

Returns the position of the user within the role hierarchy.

##### Declaration

    public int Hierarchy { get; }

##### Property Value

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

##### Remarks

The returned value equal to the position of the highest role the user has, or System.Int32.MaxValue if user is the server owner.

| Improve this Doc View Source

#### IsBot

##### Declaration

    public override bool IsBot { get; }

##### Property Value

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

##### Overrides

SocketUser.IsBot
| Improve this Doc View Source

#### IsDeafened

##### Declaration

    public bool IsDeafened { get; }

##### Property Value

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

| Improve this Doc View Source

#### IsMuted

##### Declaration

    public bool IsMuted { get; }

##### Property Value

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

| Improve this Doc View Source

#### IsSelfDeafened

##### Declaration

    public bool IsSelfDeafened { get; }

##### Property Value

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

| Improve this Doc View Source

#### IsSelfMuted

##### Declaration

    public bool IsSelfMuted { get; }

##### Property Value

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

| Improve this Doc View Source

#### IsStreaming

##### Declaration

    public bool IsStreaming { get; }

##### Property Value

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

| Improve this Doc View Source

#### IsSuppressed

##### Declaration

    public bool IsSuppressed { get; }

##### Property Value

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

| Improve this Doc View Source

#### IsWebhook

##### Declaration

    public override bool IsWebhook { get; }

##### Property Value

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

##### Overrides

SocketUser.IsWebhook
| Improve this Doc View Source

#### JoinedAt

##### Declaration

    public DateTimeOffset? JoinedAt { get; }

##### Property Value

Type | Description
--- | ---
System.Nullable<System.DateTimeOffset> |

| Improve this Doc View Source

#### Nickname

##### Declaration

    public string Nickname { get; }

##### Property Value

Type | Description
--- | ---
System.String |

| Improve this Doc View Source

#### PremiumSince

##### Declaration

    public DateTimeOffset? PremiumSince { get; }

##### Property Value

Type | Description
--- | ---
System.Nullable<System.DateTimeOffset> |

| Improve this Doc View Source

#### Roles

Returns a collection of roles that the user possesses.

##### Declaration

    public IReadOnlyCollection<SocketRole> Roles { get; }

##### Property Value

Type | Description
--- | ---
System.Collections.Generic.IReadOnlyCollection<SocketRole> |

| Improve this Doc View Source

#### Username

##### Declaration

    public override string Username { get; }

##### Property Value

Type | Description
--- | ---
System.String |

##### Overrides

SocketUser.Username
| Improve this Doc View Source

#### VoiceChannel

Returns the voice channel the user is in, or `null` if none.

##### Declaration

    public SocketVoiceChannel VoiceChannel { get; }

##### Property Value

Type | Description
--- | ---
SocketVoiceChannel |

| Improve this Doc View Source

#### VoiceSessionId

##### Declaration

    public string VoiceSessionId { get; }

##### Property Value

Type | Description
--- | ---
System.String |

| Improve this Doc View Source

#### VoiceState

Gets the voice connection status of the user if any.

##### Declaration

    public SocketVoiceState? VoiceState { get; }

##### Property Value

Type | Description
--- | ---
System.Nullable<SocketVoiceState> | A SocketVoiceState representing the user's voice status; `null` if the user is not connected to a voice channel.

### Methods

| Improve this Doc View Source

#### AddRoleAsync(IRole, RequestOptions)

##### Declaration

    public Task AddRoleAsync(IRole role, RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
IRole | role |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task |

| Improve this Doc View Source

#### AddRolesAsync(IEnumerable<IRole>, RequestOptions)

##### Declaration

    public Task AddRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Collections.Generic.IEnumerable<IRole> | roles |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task |

| Improve this Doc View Source

#### GetPermissions(IGuildChannel)

##### Declaration

    public ChannelPermissions GetPermissions(IGuildChannel channel)

##### Parameters

Type | Name | Description
--- | --- | ---
IGuildChannel | channel |

##### Returns

Type | Description
--- | ---
ChannelPermissions |

| Improve this Doc View Source

#### KickAsync(String, RequestOptions)

##### Declaration

    public Task KickAsync(string reason = null, RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | reason |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task |

| Improve this Doc View Source

#### ModifyAsync(Action<GuildUserProperties>, RequestOptions)

##### Declaration

    public Task ModifyAsync(Action<GuildUserProperties> func, RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Action<GuildUserProperties> | func |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task |

| Improve this Doc View Source

#### RemoveRoleAsync(IRole, RequestOptions)

##### Declaration

    public Task RemoveRoleAsync(IRole role, RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
IRole | role |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task |

| Improve this Doc View Source

#### RemoveRolesAsync(IEnumerable<IRole>, RequestOptions)

##### Declaration

    public Task RemoveRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Collections.Generic.IEnumerable<IRole> | roles |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task |

### Explicit Interface Implementations

| Improve this Doc View Source

#### IGuildUser.Guild

##### Declaration

    IGuild IGuildUser.Guild { get; }

##### Returns

Type | Description
--- | ---
IGuild |

| Improve this Doc View Source

#### IGuildUser.GuildId

##### Declaration

    ulong IGuildUser.GuildId { get; }

##### Returns

Type | Description
--- | ---
System.UInt64 |

| Improve this Doc View Source

#### IGuildUser.RoleIds

##### Declaration

    IReadOnlyCollection<ulong> IGuildUser.RoleIds { get; }

##### Returns

Type | Description
--- | ---
System.Collections.Generic.IReadOnlyCollection<System.UInt64> |

| Improve this Doc View Source

#### IVoiceState.VoiceChannel

##### Declaration

    IVoiceChannel IVoiceState.VoiceChannel { get; }

##### Returns

Type | Description
--- | ---
IVoiceChannel |

### Implements

IGuildUser
IUser
ISnowflakeEntity
IEntity<TId>
IMentionable
IPresence
IVoiceState