/// <summary> /// Changes a user's voice state in the specified guild /// </summary> /// <param name="guildId">ID of the guild</param> /// <param name="userId">ID of the user</param> /// <param name="muted">Whether the member should be muted or not (null for 'don't change')</param> /// <param name="deafened">Whether the member should be deafened or not (null for 'don't change')</param> public static void ChangeGuildMemberVoiceState(this DiscordClient client, ulong guildId, ulong userId, bool?muted = null, bool?deafened = null) { GuildMemberProperties properties = new GuildMemberProperties(); if (muted != null) { properties.Muted = muted.Value; } if (deafened != null) { properties.Deafened = deafened.Value; } client.ModifyGuildMember(guildId, userId, properties); }
public async Task ModifyAsync(GuildMemberProperties properties) { await Client.ModifyGuildMemberAsync(GuildId, User.Id, properties); if (properties.NickProperty.Set) { Nickname = properties.Nickname; } if (properties.RoleProperty.Set) { Roles = properties.Roles; } }
/// <summary> /// Modifies the specified guild member /// </summary> /// <param name="properties">Things to change</param> public void Modify(GuildMemberProperties properties) { ModifyAsync(properties).GetAwaiter().GetResult(); }
/// <summary> /// Modifies the specified guild member /// </summary> /// <param name="properties">Things to change</param> public void Modify(GuildMemberProperties properties) { Client.ModifyGuildMember(GuildId, User.Id, properties); }
internal static void ModifyGuildMember(this DiscordClient client, ulong guildId, ulong userId, GuildMemberProperties properties) { client.HttpClient.Patch($"/guilds/{guildId}/members/{userId}", JsonConvert.SerializeObject(properties)); }
/// <summary> /// Modifies the specified guild member /// </summary> /// <param name="guildId">ID of the guild</param> /// <param name="userId">ID of the user</param> /// <param name="properties">Things to change</param> public static void ModifyGuildMember(this DiscordClient client, ulong guildId, ulong userId, GuildMemberProperties properties) { client.HttpClient.Patch($"/guilds/{guildId}/members/{userId}", properties); }
public static void ModifyGuildMember(this DiscordClient client, ulong guildId, ulong userId, GuildMemberProperties properties) { client.ModifyGuildMemberAsync(guildId, userId, properties).GetAwaiter().GetResult(); }
public static async Task ModifyGuildMemberAsync(this DiscordClient client, ulong guildId, ulong userId, GuildMemberProperties properties) { await client.HttpClient.PatchAsync($"/guilds/{guildId}/members/{userId}", properties); }