Exemple #1
0
        /// <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);
        }
Exemple #2
0
        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;
            }
        }
Exemple #3
0
 /// <summary>
 /// Modifies the specified guild member
 /// </summary>
 /// <param name="properties">Things to change</param>
 public void Modify(GuildMemberProperties properties)
 {
     ModifyAsync(properties).GetAwaiter().GetResult();
 }
Exemple #4
0
 /// <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);
 }
Exemple #5
0
 internal static void ModifyGuildMember(this DiscordClient client, ulong guildId, ulong userId, GuildMemberProperties properties)
 {
     client.HttpClient.Patch($"/guilds/{guildId}/members/{userId}", JsonConvert.SerializeObject(properties));
 }
Exemple #6
0
 /// <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);
 }
Exemple #7
0
 public static void ModifyGuildMember(this DiscordClient client, ulong guildId, ulong userId, GuildMemberProperties properties)
 {
     client.ModifyGuildMemberAsync(guildId, userId, properties).GetAwaiter().GetResult();
 }
Exemple #8
0
 public static async Task ModifyGuildMemberAsync(this DiscordClient client, ulong guildId, ulong userId, GuildMemberProperties properties)
 {
     await client.HttpClient.PatchAsync($"/guilds/{guildId}/members/{userId}", properties);
 }