Browse Source

Remove blocking webhooks

pull/2269/head
quin lynch Quin Lynch 3 years ago
parent
commit
19b41231c5
2 changed files with 3 additions and 28 deletions
  1. +0
    -15
      src/Discord.Net.Rest/Entities/Channels/RestVoiceChannel.cs
  2. +3
    -13
      src/Discord.Net.WebSocket/Entities/Channels/SocketVoiceChannel.cs

+ 0
- 15
src/Discord.Net.Rest/Entities/Channels/RestVoiceChannel.cs View File

@@ -64,21 +64,6 @@ namespace Discord.Rest
public override Task<RestThreadChannel> CreateThreadAsync(string name, ThreadType type = ThreadType.PublicThread, ThreadArchiveDuration autoArchiveDuration = ThreadArchiveDuration.OneDay, IMessage message = null, bool? invitable = null, int? slowmode = null, RequestOptions options = null)
=> throw new InvalidOperationException("Cannot create a thread within a voice channel");

/// <inheritdoc/>
/// <exception cref="InvalidOperationException">Cannot create a webhook within a voice channel.</exception>
public override Task<RestWebhook> CreateWebhookAsync(string name, Stream avatar = null, RequestOptions options = null)
=> throw new InvalidOperationException();

/// <inheritdoc/>
/// <exception cref="InvalidOperationException">Cannot get webhooks for a voice channel.</exception>
public override Task<RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)
=> throw new InvalidOperationException();

/// <inheritdoc/>
/// <exception cref="InvalidOperationException">Cannot get webhooks for a voice channel.</exception>
public override Task<IReadOnlyCollection<RestWebhook>> GetWebhooksAsync(RequestOptions options = null)
=> throw new InvalidOperationException();

#endregion

#region Invites


+ 3
- 13
src/Discord.Net.WebSocket/Entities/Channels/SocketVoiceChannel.cs View File

@@ -104,22 +104,12 @@ namespace Discord.WebSocket
/// <exception cref="InvalidOperationException">Cannot create threads in voice channels.</exception>
public override Task<SocketThreadChannel> CreateThreadAsync(string name, ThreadType type = ThreadType.PublicThread, ThreadArchiveDuration autoArchiveDuration = ThreadArchiveDuration.OneDay, IMessage message = null, bool? invitable = null, int? slowmode = null, RequestOptions options = null)
=> throw new InvalidOperationException("Voice channels cannot contain threads.");
/// <inheritdoc/>
/// <exception cref="InvalidOperationException">Cannot create webhooks in voice channels.</exception>
public override Task<RestWebhook> CreateWebhookAsync(string name, Stream avatar = null, RequestOptions options = null)
=> throw new InvalidOperationException("Voice channels cannot contain webhooks.");
/// <inheritdoc/>
/// <exception cref="InvalidOperationException">Cannot modify text channel properties within a webhook.</exception>
/// <exception cref="InvalidOperationException">Cannot modify text channel properties within a voice channel.</exception>
public override Task ModifyAsync(Action<TextChannelProperties> func, RequestOptions options = null)
=> throw new InvalidOperationException("Cannot modify text channel properties for voice channels.");
/// <inheritdoc/>
/// <exception cref="InvalidOperationException">Cannot get webhooks for a voice channel.</exception>
public override Task<RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)
=> throw new InvalidOperationException("Cannot get webhooks for a voice channel.");
/// <inheritdoc/>
/// <exception cref="InvalidOperationException">Cannot get webhooks for a voice channel.</exception>
public override Task<IReadOnlyCollection<RestWebhook>> GetWebhooksAsync(RequestOptions options = null)
=> throw new InvalidOperationException("Cannot get webhooks for a voice channel.");
#endregion

#region Invites


Loading…
Cancel
Save