Interface IGuildUser
Represents a generic guild user.
Assembly: Discord.Net.Core.dll​
View Source​
public interface IGuildUser : IUser, ISnowflakeEntity, IEntity<ulong>, IMentionable, IPresence, IVoiceState
Properties​
JoinedAt​
Gets when this user joined the guild.
View Source​
DateTimeOffset? JoinedAt { get; }
Nickname​
Gets the nickname for this user.
View Source​
string Nickname { get; }
GuildAvatarId​
Gets the guild specific avatar for this users.
View Source​
string GuildAvatarId { get; }
GuildPermissions​
Gets the guild-level permissions for this user.
View Source​
GuildPermissions GuildPermissions { get; }
Guild​
Gets the guild for this user.
View Source​
IGuild Guild { get; }
GuildId​
Gets the ID of the guild for this user.
View Source​
ulong GuildId { get; }
PremiumSince​
Gets the date and time for when this user's guild boost began.
View Source​
DateTimeOffset? PremiumSince { get; }
RoleIds​
Gets a collection of IDs for the roles that this user currently possesses in the guild.
View Source​
IReadOnlyCollection<ulong> RoleIds { get; }
IsPending​
Whether the user has passed the guild's Membership Screening requirements.
View Source​
bool? IsPending { get; }
Hierarchy​
Gets the users position within the role hierarchy.
View Source​
int Hierarchy { get; }
Methods​
GetPermissions(IGuildChannel)​
Gets the level permissions granted to this user to a given channel.
View Source​
ChannelPermissions GetPermissions(IGuildChannel channel)
Returns​
Discord.ChannelPermissions: A Discord.ChannelPermissions structure representing the permissions that a user has in the specified channel.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IGuildChannel | channel | The channel to get the permission from. |
GetGuildAvatarUrl(ImageFormat, UInt16)​
Gets the guild avatar URL for this user.
View Source​
string GetGuildAvatarUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128)
Returns​
System.String
:
A string representing the user's avatar URL; null
if the user does not have an avatar in place.
Parameters​
Type | Name | Description |
---|---|---|
Discord.ImageFormat | format | The format to return. |
System.UInt16 | size | The size of the image to return in. This can be any power of two between 16 and 2048. |
KickAsync(String, RequestOptions)​
Kicks this user from this guild.
View Source​
Task KickAsync(string reason = null, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous kick operation.
Parameters​
Type | Name | Description |
---|---|---|
System.String | reason | The reason for the kick which will be recorded in the audit log. |
Discord.RequestOptions | options | The options to be used when sending the request. |
ModifyAsync(Action<GuildUserProperties>, RequestOptions)​
Modifies this user's properties in this guild.
View Source​
Task ModifyAsync(Action<GuildUserProperties> func, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous modification operation.
Parameters​
Type | Name | Description |
---|---|---|
System.Action<Discord.GuildUserProperties> | func | The delegate containing the properties to modify the user with. |
Discord.RequestOptions | options | The options to be used when sending the request. |
AddRoleAsync(UInt64, RequestOptions)​
Adds the specified role to this user in the guild.
View Source​
Task AddRoleAsync(ulong roleId, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous role addition operation.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | roleId | The role to be added to the user. |
Discord.RequestOptions | options | The options to be used when sending the request. |
AddRoleAsync(IRole, RequestOptions)​
Adds the specified role to this user in the guild.
View Source​
Task AddRoleAsync(IRole role, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous role addition operation.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IRole | role | The role to be added to the user. |
Discord.RequestOptions | options | The options to be used when sending the request. |
AddRolesAsync(IEnumerable<UInt64>, RequestOptions)​
Adds the specified <code data-dev-comment-type="paramref" class="paramref">roleIds</code> to this user in the guild.
View Source​
Task AddRolesAsync(IEnumerable<ulong> roleIds, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous role addition operation.
Parameters​
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.UInt64> | roleIds | The roles to be added to the user. |
Discord.RequestOptions | options | The options to be used when sending the request. |
AddRolesAsync(IEnumerable<IRole>, RequestOptions)​
Adds the specified <code data-dev-comment-type="paramref" class="paramref">roles</code> to this user in the guild.
View Source​
Task AddRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous role addition operation.
Parameters​
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Discord.IRole> | roles | The roles to be added to the user. |
Discord.RequestOptions | options | The options to be used when sending the request. |
RemoveRoleAsync(UInt64, RequestOptions)​
Removes the specified <code data-dev-comment-type="paramref" class="paramref">roleId</code> from this user in the guild.
View Source​
Task RemoveRoleAsync(ulong roleId, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous role removal operation.
Parameters​
Type | Name | Description |
---|---|---|
System.UInt64 | roleId | The role to be removed from the user. |
Discord.RequestOptions | options | The options to be used when sending the request. |
RemoveRoleAsync(IRole, RequestOptions)​
Removes the specified <code data-dev-comment-type="paramref" class="paramref">role</code> from this user in the guild.
View Source​
Task RemoveRoleAsync(IRole role, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous role removal operation.
Parameters​
Type | Name | Description |
---|---|---|
Discord.IRole | role | The role to be removed from the user. |
Discord.RequestOptions | options | The options to be used when sending the request. |
RemoveRolesAsync(IEnumerable<UInt64>, RequestOptions)​
Removes the specified <code data-dev-comment-type="paramref" class="paramref">roleIds</code> from this user in the guild.
View Source​
Task RemoveRolesAsync(IEnumerable<ulong> roleIds, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous role removal operation.
Parameters​
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.UInt64> | roleIds | The roles to be removed from the user. |
Discord.RequestOptions | options | The options to be used when sending the request. |
RemoveRolesAsync(IEnumerable<IRole>, RequestOptions)​
Removes the specified <code data-dev-comment-type="paramref" class="paramref">roles</code> from this user in the guild.
View Source​
Task RemoveRolesAsync(IEnumerable<IRole> roles, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous role removal operation.
Parameters​
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Discord.IRole> | roles | The roles to be removed from the user. |
Discord.RequestOptions | options | The options to be used when sending the request. |
Extension Methods​
- Discord.IUser.Discord.UserExtensions.SendMessageAsync(System.String,System.Boolean,Discord.Embed,Discord.RequestOptions,Discord.AllowedMentions,Discord.MessageComponent,Discord.Embed[])
- Discord.IUser.Discord.UserExtensions.SendFileAsync(System.IO.Stream,System.String,System.String,System.Boolean,Discord.Embed,Discord.RequestOptions,Discord.MessageComponent,Discord.Embed[])
- Discord.IUser.Discord.UserExtensions.SendFileAsync(System.String,System.String,System.Boolean,Discord.Embed,Discord.RequestOptions,Discord.MessageComponent,Discord.Embed[])
- Discord.IGuildUser.Discord.UserExtensions.BanAsync(System.Int32,System.String,Discord.RequestOptions)