Class SocketGuildUser
Represents a WebSocket-based guild user.
Inherited Members
Namespace: Kook.WebSocket
Assembly: Kook.Net.WebSocket.dll
Syntax
public class SocketGuildUser : SocketUser, IEntity<ulong>, IGuildUser, IUser, IEntity<ulong>, IMentionable, IPresence, IVoiceState, IUpdateable
Properties
ActiveAt
Declaration
public DateTimeOffset ActiveAt { get; }
Property Value
DateTimeOffset
|
Avatar
Banner
BoostSubscriptions
Gets a collection of all boost subscriptions of this user for this guild.
Declaration
public IReadOnlyCollection<BoostSubscriptionMetadata> BoostSubscriptions { get; }
Property Value
IReadOnlyCollection<BoostSubscriptionMetadata>
A read-only collection of boost subscription metadata of this user for this guild;
or |
Remarks
warning
Only when AlwaysDownloadBoostSubscriptions is set to true
will this property be populated upon startup. Due to the lack of event support for boost subscriptions,
this property may be not up-to-date. The changes of BoostSubscriptionCount will trigger the update
of this property, but KOOK gateway will not publish this event resulting from the changes of total boost subscription
count. To fetch the latest boost subscription data, use DownloadBoostSubscriptionsAsync(RequestOptions) upon SocketGuild
or DownloadBoostSubscriptionsAsync(IEnumerable<IGuild>, RequestOptions)
upon a KookSocketClient to manually download the latest boost subscription data,
or GetBoostSubscriptionsAsync(RequestOptions).
See Also
BuffAvatar
Color
Gets the color the user's displayed name is being displayed in.
Declaration
public Color Color { get; }
Property Value
Color
A Color struct representing the color the user's display name is being displayed in. |
Implements
Remarks
warning
At present, the color of a role may be a solid color or a gradient. See ColorType, which is guaranteed due to the fact that the guild's user list API endpoint returns the color type and the gradient color information if exists. However, the value of this property is fetched from the guild's user list API endpoint, which does not return the color type and the gradient color information. Hence, the value of this property may be incorrect if the color of a role is a gradient.
DisplayName
Guild
Gets the guild the user is in.
Declaration
public SocketGuild Guild { get; }
Property Value
SocketGuild
|
GuildPermissions
Gets the guild-level permissions for this user.
Declaration
public GuildPermissions GuildPermissions { get; }
Property Value
GuildPermissions
A GuildPermissions structure for this user, representing what permissions this user has in the guild. |
Implements
HasBuff
IdentifyNumberValue
Declaration
public override ushort? IdentifyNumberValue { get; }
Property Value
Nullable<UInt16>
|
Overrides
IsBanned
IsBot
IsDeafened
IsDenoiseEnabled
Declaration
public override bool? IsDenoiseEnabled { get; }
Property Value
Nullable<Boolean>
|
Overrides
IsMobileVerified
IsMuted
IsOwner
JoinedAt
Declaration
public DateTimeOffset JoinedAt { get; }
Property Value
DateTimeOffset
|
Nickname
PlainTextMention
Roles
Returns a collection of roles that the user possesses.
Declaration
public IReadOnlyCollection<SocketRole> Roles { get; }
Property Value
IReadOnlyCollection<SocketRole>
|
Remarks
warning
Due to the lack of events which should be raised when a role is added or removed from a user, this property may not be completely accurate. To ensure the most accurate results, it is recommended to call UpdateAsync(RequestOptions) before this property is used.
Username
UserTag
Get the tag this user has.
Declaration
public override UserTag UserTag { get; }
Property Value
UserTag
|
Overrides
Implements
VoiceChannel
Returns the voice channel the user is in, or null
if none or unknown.
warning
If a user connects to a voice channel before the bot has connected to the gateway,
this property will be null
until DownloadVoiceStatesAsync(RequestOptions)
or DownloadVoiceStatesAsync(IEnumerable<IGuild>, RequestOptions) is called.
To ensure whether the user is in a voice channel or not, use those methods above,
or GetConnectedVoiceChannelsAsync(RequestOptions).
Declaration
public SocketVoiceChannel VoiceChannel { get; }
Property Value
SocketVoiceChannel
|
VoiceState
Gets the voice status of the user if any.
Declaration
public SocketVoiceState? VoiceState { get; }
Property Value
Nullable<SocketVoiceState>
A SocketVoiceState representing the user's voice status; |
Methods
AddRoleAsync(IRole, RequestOptions)
Declaration
public Task AddRoleAsync(IRole role, RequestOptions options = null)
Parameters
IRole
role
|
RequestOptions
options
|
Returns
Task
|
AddRoleAsync(UInt32, RequestOptions)
Declaration
public Task AddRoleAsync(uint roleId, RequestOptions options = null)
Parameters
UInt32
roleId
|
RequestOptions
options
|
Returns
Task
|
AddRolesAsync(IEnumerable<IRole>, RequestOptions)
Declaration
public Task AddRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null)
Parameters
IEnumerable<IRole>
roles
|
RequestOptions
options
|
Returns
Task
|
AddRolesAsync(IEnumerable<UInt32>, RequestOptions)
Declaration
public Task AddRolesAsync(IEnumerable<uint> roleIds, RequestOptions options = null)
Parameters
IEnumerable<UInt32>
roleIds
|
RequestOptions
options
|
Returns
Task
|
DeafenAsync(RequestOptions)
Declaration
public Task DeafenAsync(RequestOptions options = null)
Parameters
RequestOptions
options
|
Returns
Task
|
GetBoostSubscriptionsAsync(RequestOptions)
Declaration
public Task<IReadOnlyCollection<BoostSubscriptionMetadata>> GetBoostSubscriptionsAsync(RequestOptions options = null)
Parameters
RequestOptions
options
|
Returns
Task<IReadOnlyCollection<BoostSubscriptionMetadata>>
|
GetConnectedVoiceChannelsAsync(RequestOptions)
Gets a collection of voice channels a user.
Declaration
public Task<IReadOnlyCollection<SocketVoiceChannel>> GetConnectedVoiceChannelsAsync(RequestOptions options = null)
Parameters
RequestOptions
options
The options to be used when sending the request. |
Returns
Task<IReadOnlyCollection<SocketVoiceChannel>>
A task that represents the asynchronous get operation. The task result contains a collection of voice channels the user is connected to. |
GetPermissions(IGuildChannel)
Gets the level permissions granted to this user to a given channel.
Declaration
public ChannelPermissions GetPermissions(IGuildChannel channel)
Parameters
IGuildChannel
channel
The channel to get the permission from. |
Returns
ChannelPermissions
A ChannelPermissions structure representing the permissions that a user has in the specified channel. |
Implements
KickAsync(RequestOptions)
Declaration
public Task KickAsync(RequestOptions options = null)
Parameters
RequestOptions
options
|
Returns
Task
|
ModifyNicknameAsync(String, RequestOptions)
Declaration
public Task ModifyNicknameAsync(string name, RequestOptions options = null)
Parameters
String
name
|
RequestOptions
options
|
Returns
Task
|
MuteAsync(RequestOptions)
Declaration
public Task MuteAsync(RequestOptions options = null)
Parameters
RequestOptions
options
|
Returns
Task
|
RemoveRoleAsync(IRole, RequestOptions)
Declaration
public Task RemoveRoleAsync(IRole role, RequestOptions options = null)
Parameters
IRole
role
|
RequestOptions
options
|
Returns
Task
|
RemoveRoleAsync(UInt32, RequestOptions)
Declaration
public Task RemoveRoleAsync(uint roleId, RequestOptions options = null)
Parameters
UInt32
roleId
|
RequestOptions
options
|
Returns
Task
|
RemoveRolesAsync(IEnumerable<IRole>, RequestOptions)
Declaration
public Task RemoveRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null)
Parameters
IEnumerable<IRole>
roles
|
RequestOptions
options
|
Returns
Task
|
RemoveRolesAsync(IEnumerable<UInt32>, RequestOptions)
Declaration
public Task RemoveRolesAsync(IEnumerable<uint> roleIds, RequestOptions options = null)
Parameters
IEnumerable<UInt32>
roleIds
|
RequestOptions
options
|
Returns
Task
|
UndeafenAsync(RequestOptions)
Declaration
public Task UndeafenAsync(RequestOptions options = null)
Parameters
RequestOptions
options
|
Returns
Task
|
UnmuteAsync(RequestOptions)
Declaration
public Task UnmuteAsync(RequestOptions options = null)
Parameters
RequestOptions
options
|
Returns
Task
|
UpdateAsync(RequestOptions)
Fetches the users data from the REST API to update this object, especially the Roles property.
Declaration
public Task UpdateAsync(RequestOptions options = null)
Parameters
RequestOptions
options
The options to be used when sending the request. |
Returns
Task
A task that represents the asynchronous reloading operation. |
Explicit Interface Implementations
IGuildUser.Guild
Gets the guild for this user.
Declaration
IGuild IGuildUser.Guild { get; }
Returns
IGuild
A guild object that this user belongs to. |
Implements
IVoiceState.VoiceChannel
Gets the voice channel this user is currently in.
Declaration
IVoiceChannel IVoiceState.VoiceChannel { get; }
Returns
IVoiceChannel
A generic voice channel object representing the voice channel that the user is currently in; |