[Feature] Text-In-Stage support & missing IVoiceChannel properties (#2610)

* initial commit

* add a check for voice/stage channels in `PinAsync`

* moar refactoring

* Update IStageChannel.cs

* forgot about mocked. again.
This commit is contained in:
Misha133
2023-02-26 22:55:23 +03:00
committed by GitHub
parent e69e27aa44
commit 76bb9018c4
11 changed files with 59 additions and 435 deletions

View File

@@ -8,14 +8,6 @@ namespace Discord
/// </summary>
public interface IStageChannel : IVoiceChannel
{
/// <summary>
/// Gets the topic of the Stage instance.
/// </summary>
/// <remarks>
/// If the stage isn't live then this property will be set to <see langword="null"/>.
/// </remarks>
string Topic { get; }
/// <summary>
/// Gets the <see cref="StagePrivacyLevel"/> of the current stage.
/// </summary>

View File

@@ -7,7 +7,7 @@ namespace Discord
/// <summary>
/// Represents a generic voice channel in a guild.
/// </summary>
public interface IVoiceChannel : IMessageChannel, INestedChannel, IAudioChannel, IMentionable
public interface IVoiceChannel : ITextChannel, IAudioChannel
{
/// <summary>
/// Gets the bit-rate that the clients in this voice channel are requested to use.
@@ -31,44 +31,6 @@ namespace Discord
/// </summary>
VideoQualityMode VideoQualityMode { get; }
/// <summary>
/// Bulk-deletes multiple messages.
/// </summary>
/// <example>
/// <para>The following example gets 250 messages from the channel and deletes them.</para>
/// <code language="cs">
/// var messages = await voiceChannel.GetMessagesAsync(250).FlattenAsync();
/// await voiceChannel.DeleteMessagesAsync(messages);
/// </code>
/// </example>
/// <remarks>
/// This method attempts to remove the messages specified in bulk.
/// <note type="important">
/// Due to the limitation set by Discord, this method can only remove messages that are posted within 14 days!
/// </note>
/// </remarks>
/// <param name="messages">The messages to be bulk-deleted.</param>
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>
/// A task that represents the asynchronous bulk-removal operation.
/// </returns>
Task DeleteMessagesAsync(IEnumerable<IMessage> messages, RequestOptions options = null);
/// <summary>
/// Bulk-deletes multiple messages.
/// </summary>
/// <remarks>
/// This method attempts to remove the messages specified in bulk.
/// <note type="important">
/// Due to the limitation set by Discord, this method can only remove messages that are posted within 14 days!
/// </note>
/// </remarks>
/// <param name="messageIds">The snowflake identifier of the messages to be bulk-deleted.</param>
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>
/// A task that represents the asynchronous bulk-removal operation.
/// </returns>
Task DeleteMessagesAsync(IEnumerable<ulong> messageIds, RequestOptions options = null);
/// <summary>
/// Modifies this voice channel.
/// </summary>

View File

@@ -1,26 +1,33 @@
namespace Discord
using System;
namespace Discord;
/// <summary>
/// Provides properties that are used to modify an <see cref="IVoiceChannel" /> with the specified changes.
/// </summary>
public class VoiceChannelProperties : TextChannelProperties
{
/// <summary>
/// Provides properties that are used to modify an <see cref="IVoiceChannel" /> with the specified changes.
/// Gets or sets the bitrate of the voice connections in this channel. Must be greater than 8000.
/// </summary>
public class VoiceChannelProperties : GuildChannelProperties
{
/// <summary>
/// Gets or sets the bitrate of the voice connections in this channel. Must be greater than 8000.
/// </summary>
public Optional<int> Bitrate { get; set; }
/// <summary>
/// Gets or sets the maximum number of users that can be present in a channel, or <c>null</c> if none.
/// </summary>
public Optional<int?> UserLimit { get; set; }
/// <summary>
/// Gets or sets the channel voice region id, automatic when set to <see langword="null"/>.
/// </summary>
public Optional<string> RTCRegion { get; set; }
public Optional<int> Bitrate { get; set; }
/// <summary>
/// Gets or sets the maximum number of users that can be present in a channel, or <c>null</c> if none.
/// </summary>
public Optional<int?> UserLimit { get; set; }
/// <summary>
/// Gets or sets the channel voice region id, automatic when set to <see langword="null"/>.
/// </summary>
public Optional<string> RTCRegion { get; set; }
/// <summary>
/// Get or sets the video quality mode for this channel.
/// </summary>
public Optional<VideoQualityMode> VideoQualityMode { get; set; }
}
/// <summary>
/// Get or sets the video quality mode for this channel.
/// </summary>
public Optional<VideoQualityMode> VideoQualityMode { get; set; }
/// <remarks>
/// Not supported in voice channels
/// </remarks>
/// <inheritdoc cref="TextChannelProperties.Topic"/>
public new Optional<string> Topic { get; }
}