[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

@@ -212,6 +212,8 @@ namespace Discord.Rest
public static async Task PinAsync(IMessage msg, BaseDiscordClient client,
RequestOptions options)
{
if (msg.Channel is IVoiceChannel)
throw new NotSupportedException("Pinned messages are not supported in text-in-voice channels.");
await client.ApiClient.AddPinAsync(msg.Channel.Id, msg.Id, options).ConfigureAwait(false);
}