Table of Contents

Class GuildUserProperties

Namespace
Discord
Assembly
Discord.Net.Core.dll

Properties that are used to modify an IGuildUser with the following parameters.

public class GuildUserProperties
Inheritance
GuildUserProperties
Inherited Members

Examples

The following example uses ModifyAsync to apply changes specified in the properties,

var user = guild.GetUser(id);
if (user == null) return;

await user.ModifyAsync(x =>
{
    x.Nickname = "I need healing";
});

Properties

Channel

Moves a user to a voice channel. If null, this user will be disconnected from their current voice channel.

public Optional<IVoiceChannel> Channel { get; set; }

Property Value

Optional<IVoiceChannel>

Remarks

This user MUST already be in a IVoiceChannel for this to work. When set, this property takes precedence over ChannelId.

ChannelId

Moves a user to a voice channel. Set Channel to null to disconnect this user from their current voice channel.

public Optional<ulong?> ChannelId { get; set; }

Property Value

Optional<ulong?>

Remarks

This user MUST already be in a IVoiceChannel for this to work.

Deaf

Gets or sets whether the user should be deafened in a voice channel.

public Optional<bool> Deaf { get; set; }

Property Value

Optional<bool>

Remarks

If this value is set to true, this user will not be able to hear anyone speak in the guild.

Flags

Gets or sets the flags of the guild member.

public Optional<GuildUserFlags> Flags { get; set; }

Property Value

Optional<GuildUserFlags>

Remarks

Not all flags can be modified, these are reserved for Discord.

Mute

Gets or sets whether the user should be muted in a voice channel.

public Optional<bool> Mute { get; set; }

Property Value

Optional<bool>

Remarks

If this value is set to true, no user will be able to hear this user speak in the guild.

Nickname

Gets or sets the user's nickname.

public Optional<string> Nickname { get; set; }

Property Value

Optional<string>

Remarks

To clear the user's nickname, this value can be set to null or Empty.

RoleIds

Gets or sets the roles the user should have.

public Optional<IEnumerable<ulong>> RoleIds { get; set; }

Property Value

Optional<IEnumerable<ulong>>

Remarks

Roles

Gets or sets the roles the user should have.

public Optional<IEnumerable<IRole>> Roles { get; set; }

Property Value

Optional<IEnumerable<IRole>>

Remarks

TimedOutUntil

Sets a timestamp how long a user should be timed out for.

public Optional<DateTimeOffset?> TimedOutUntil { get; set; }

Property Value

Optional<DateTimeOffset?>

Remarks

null or a time in the past to clear a currently existing timeout.

See Also