Skip to content

Commit

Permalink
Added modifying voice channel password
Browse files Browse the repository at this point in the history
  • Loading branch information
gehongyan committed Dec 21, 2022
1 parent b66dc49 commit d6c362f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@ public class ModifyVoiceChannelProperties : ModifyGuildChannelProperties
/// <c>null</c> if not set.
/// </summary>
public int? UserLimit { get; set; }

/// <summary>
/// Gets or sets the password of the channel, or empty string to clear the password; <c>null</c> if not set.
/// </summary>
public string Password { get; set; }
}
4 changes: 4 additions & 0 deletions src/Kook.Net.Rest/API/Rest/ModifyVoiceChannelParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ internal class ModifyVoiceChannelParams : ModifyGuildChannelParams

[JsonPropertyName("limit_amount")]
public int? UserLimit { get; set; }

[JsonPropertyName("password")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string Password { get; set; }
}
3 changes: 2 additions & 1 deletion src/Kook.Net.Rest/Entities/Channels/ChannelHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public static async Task<Model> ModifyAsync(IVoiceChannel channel, BaseKookClien
Position = args.Position,
CategoryId = args.CategoryId,
VoiceQuality = args.VoiceQuality,
UserLimit = args.UserLimit
UserLimit = args.UserLimit,
Password = args.Password
};
return await client.ApiClient.ModifyGuildChannelAsync(channel.Id, apiArgs, options).ConfigureAwait(false);
}
Expand Down

0 comments on commit d6c362f

Please sign in to comment.