Show / Hide Table of Contents

# Class SocketWebhookUser

Represents a WebSocket-based webhook user.

##### Inheritance

System.Object
SocketEntity<System.UInt64>
SocketUser
SocketWebhookUser

##### Implements

IWebhookUser
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 SocketWebhookUser : SocketUser, IWebhookUser, IGuildUser, IUser, ISnowflakeEntity, IEntity<ulong>, IMentionable, IPresence, IVoiceState

### Properties

| Improve this Doc View Source

#### AvatarId

Gets the identifier of this user's avatar.

##### Declaration

    public override string AvatarId { get; }

##### Property Value

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

##### Overrides

SocketUser.AvatarId
| Improve this Doc View Source

#### DiscriminatorValue

Gets the per-username unique ID for this user.

##### Declaration

    public override ushort DiscriminatorValue { get; }

##### Property Value

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

##### Overrides

SocketUser.DiscriminatorValue
| Improve this Doc View Source

#### Guild

Gets the guild of this webhook.

##### Declaration

    public SocketGuild Guild { get; }

##### Property Value

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

| Improve this Doc View Source

#### IsBot

Gets a value that indicates whether this user is identified as a bot.

##### Declaration

    public override bool IsBot { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean | `true` if the user is a bot application; otherwise `false`.

##### Overrides

SocketUser.IsBot

##### Remarks

This property retrieves a value that indicates whether this user is a registered bot application (indicated by the blue BOT tag within the official chat client).

| Improve this Doc View Source

#### IsWebhook

Gets a value that indicates whether this user is a webhook user.

##### Declaration

    public override bool IsWebhook { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean | `true` if the user is a webhook; otherwise `false`.

##### Overrides

SocketUser.IsWebhook
| Improve this Doc View Source

#### Username

Gets the username for this user.

##### Declaration

    public override string Username { get; }

##### Property Value

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

##### Overrides

SocketUser.Username
| Improve this Doc View Source

#### WebhookId

Gets the ID of a webhook.

##### Declaration

    public ulong WebhookId { get; }

##### Property Value

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

### Explicit Interface Implementations

| Improve this Doc View Source

#### IGuildUser.AddRoleAsync(IRole, RequestOptions)

Adds the specified role to this user in the guild.

##### Declaration

    Task IGuildUser.AddRoleAsync(IRole role, RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
IRole | role | The role to be added to the user.
RequestOptions | options | The options to be used when sending the request.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task | A task that represents the asynchronous role addition operation.

##### Exceptions

Type | Condition
--- | ---
System.NotSupportedException | Roles are not supported on webhook users.

| Improve this Doc View Source

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

Adds the specified `roles` to this user in the guild.

##### Declaration

    Task IGuildUser.AddRolesAsync(IEnumerable<IRole> roles, RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Collections.Generic.IEnumerable<IRole> | roles | The roles to be added to the user.
RequestOptions | options | The options to be used when sending the request.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task | A task that represents the asynchronous role addition operation.

##### Exceptions

Type | Condition
--- | ---
System.NotSupportedException | Roles are not supported on webhook users.

| Improve this Doc View Source

#### IGuildUser.GetPermissions(IGuildChannel)

Gets the level permissions granted to this user to a given channel.

##### Declaration

    ChannelPermissions IGuildUser.GetPermissions(IGuildChannel channel)

##### Parameters

Type | Name | Description
--- | --- | ---
IGuildChannel | channel | The channel to get the permission from.

##### Returns

Type | Description
--- | ---
ChannelPermissions | A ChannelPermissions structure representing the permissions that a user has in the specified channel.

| Improve this Doc View Source

#### IGuildUser.Guild

Gets the guild for this user.

##### Declaration

    IGuild IGuildUser.Guild { get; }

##### Returns

Type | Description
--- | ---
IGuild | A guild object that this user belongs to.

| Improve this Doc View Source

#### IGuildUser.GuildId

Gets the ID of the guild for this user.

##### Declaration

    ulong IGuildUser.GuildId { get; }

##### Returns

Type | Description
--- | ---
System.UInt64 | An System.UInt64 representing the snowflake identifier of the guild that this user belongs to.

| Improve this Doc View Source

#### IGuildUser.GuildPermissions

Gets the guild-level permissions for this user.

##### Declaration

    GuildPermissions IGuildUser.GuildPermissions { get; }

##### Returns

Type | Description
--- | ---
GuildPermissions | A GuildPermissions structure for this user, representing what permissions this user has in the guild.

| Improve this Doc View Source

#### IGuildUser.JoinedAt

Gets when this user joined the guild.

##### Declaration

    DateTimeOffset? IGuildUser.JoinedAt { get; }

##### Returns

Type | Description
--- | ---
System.Nullable<System.DateTimeOffset> | A System.DateTimeOffset representing the time of which the user has joined the guild; `null` when it cannot be obtained.

| Improve this Doc View Source

#### IGuildUser.KickAsync(String, RequestOptions)

Kicks this user from this guild.

##### Declaration

    Task IGuildUser.KickAsync(string reason, RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | reason | The reason for the kick which will be recorded in the audit log.
RequestOptions | options | The options to be used when sending the request.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task | A task that represents the asynchronous kick operation.

##### Exceptions

Type | Condition
--- | ---
System.NotSupportedException | Webhook users cannot be kicked.

| Improve this Doc View Source

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

Modifies this user's properties in this guild.

##### Declaration

    Task IGuildUser.ModifyAsync(Action<GuildUserProperties> func, RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Action<GuildUserProperties> | func | The delegate containing the properties to modify the user with.
RequestOptions | options | The options to be used when sending the request.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task | A task that represents the asynchronous modification operation.

##### Remarks

This method modifies the current guild user with the specified properties. To see an example of this method and what properties are available, please refer to GuildUserProperties.

##### Exceptions

Type | Condition
--- | ---
System.NotSupportedException | Webhook users cannot be modified.

| Improve this Doc View Source

#### IGuildUser.Nickname

Gets the nickname for this user.

##### Declaration

    string IGuildUser.Nickname { get; }

##### Returns

Type | Description
--- | ---
System.String | A string representing the nickname of the user; `null` if none is set.

| Improve this Doc View Source

#### IGuildUser.PremiumSince

Gets the date and time for when this user's guild boost began.

##### Declaration

    DateTimeOffset? IGuildUser.PremiumSince { get; }

##### Returns

Type | Description
--- | ---
System.Nullable<System.DateTimeOffset> | A System.DateTimeOffset for when the user began boosting this guild; `null` if they are not boosting the guild.

| Improve this Doc View Source

#### IGuildUser.RemoveRoleAsync(IRole, RequestOptions)

Removes the specified `role` from this user in the guild.

##### Declaration

    Task IGuildUser.RemoveRoleAsync(IRole role, RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
IRole | role | The role to be removed from the user.
RequestOptions | options | The options to be used when sending the request.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task | A task that represents the asynchronous role removal operation.

##### Exceptions

Type | Condition
--- | ---
System.NotSupportedException | Roles are not supported on webhook users.

| Improve this Doc View Source

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

Removes the specified `roles` from this user in the guild.

##### Declaration

    Task IGuildUser.RemoveRolesAsync(IEnumerable<IRole> roles, RequestOptions options)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Collections.Generic.IEnumerable<IRole> | roles | The roles to be removed from the user.
RequestOptions | options | The options to be used when sending the request.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task | A task that represents the asynchronous role removal operation.

##### Exceptions

Type | Condition
--- | ---
System.NotSupportedException | Roles are not supported on webhook users.

| Improve this Doc View Source

#### IGuildUser.RoleIds

Gets a collection of IDs for the roles that this user currently possesses in the guild.

##### Declaration

    IReadOnlyCollection<ulong> IGuildUser.RoleIds { get; }

##### Returns

Type | Description
--- | ---
System.Collections.Generic.IReadOnlyCollection<System.UInt64> | A read-only collection of System.UInt64, each representing a snowflake identifier for a role that this user possesses.

##### Remarks

This property returns a read-only collection of the identifiers of the roles that this user possesses. For WebSocket users, a Roles property can be found in place of this property. Due to the REST implementation, only a collection of identifiers can be retrieved instead of the full role objects.

| Improve this Doc View Source

#### IVoiceState.IsDeafened

Gets a value that indicates whether this user is deafened by the guild.

##### Declaration

    bool IVoiceState.IsDeafened { get; }

##### Returns

Type | Description
--- | ---
System.Boolean | `true` if the user is deafened (i.e. not permitted to listen to or speak to others) by the guild; otherwise `false`.

| Improve this Doc View Source

#### IVoiceState.IsMuted

Gets a value that indicates whether this user is muted (i.e. not permitted to speak via voice) by the guild.

##### Declaration

    bool IVoiceState.IsMuted { get; }

##### Returns

Type | Description
--- | ---
System.Boolean | `true` if this user is muted by the guild; otherwise `false`.

| Improve this Doc View Source

#### IVoiceState.IsSelfDeafened

Gets a value that indicates whether this user has marked themselves as deafened.

##### Declaration

    bool IVoiceState.IsSelfDeafened { get; }

##### Returns

Type | Description
--- | ---
System.Boolean | `true` if this user has deafened themselves (i.e. not permitted to listen to or speak to others); otherwise `false`.

| Improve this Doc View Source

#### IVoiceState.IsSelfMuted

Gets a value that indicates whether this user has marked themselves as muted (i.e. not permitted to speak via voice).

##### Declaration

    bool IVoiceState.IsSelfMuted { get; }

##### Returns

Type | Description
--- | ---
System.Boolean | `true` if this user has muted themselves; otherwise `false`.

| Improve this Doc View Source

#### IVoiceState.IsStreaming

Gets a value that indicates if this user is streaming in a voice channel.

##### Declaration

    bool IVoiceState.IsStreaming { get; }

##### Returns

Type | Description
--- | ---
System.Boolean | `true` if the user is streaming; otherwise `false`.

| Improve this Doc View Source

#### IVoiceState.IsSuppressed

Gets a value that indicates whether the user is muted by the current user.

##### Declaration

    bool IVoiceState.IsSuppressed { get; }

##### Returns

Type | Description
--- | ---
System.Boolean | `true` if the guild is temporarily blocking audio to/from this user; otherwise `false`.

| Improve this Doc View Source

#### IVoiceState.VoiceChannel

Gets the voice channel this user is currently in.

##### Declaration

    IVoiceChannel IVoiceState.VoiceChannel { get; }

##### Returns

Type | Description
--- | ---
IVoiceChannel | A generic voice channel object representing the voice channel that the user is currently in; `null` if none.

| Improve this Doc View Source

#### IVoiceState.VoiceSessionId

Gets the unique identifier for this user's voice session.

##### Declaration

    string IVoiceState.VoiceSessionId { get; }

##### Returns

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

### Implements

IWebhookUser
IGuildUser
IUser
ISnowflakeEntity
IEntity<TId>
IMentionable
IPresence
IVoiceState