[Feature] Follow news channels (#2590)

* initial commit

* Apply suggestions from code review

---------

Co-authored-by: Casmir <68127614+csmir@users.noreply.github.com>
This commit is contained in:
Misha133
2023-02-09 18:45:04 +03:00
committed by GitHub
parent 2ea8af1dde
commit bb056dfec0
6 changed files with 52 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model = Discord.API.Channel;
namespace Discord.Rest
@@ -15,7 +16,7 @@ namespace Discord.Rest
public class RestNewsChannel : RestTextChannel, INewsChannel
{
internal RestNewsChannel(BaseDiscordClient discord, IGuild guild, ulong id)
:base(discord, guild, id)
: base(discord, guild, id)
{
}
internal new static RestNewsChannel Create(BaseDiscordClient discord, IGuild guild, Model model)
@@ -25,5 +26,9 @@ namespace Discord.Rest
return entity;
}
public override int SlowModeInterval => throw new NotSupportedException("News channels do not support Slow Mode.");
/// <inheritdoc />
public Task<ulong> FollowAnnouncementChannelAsync(ulong channelId, RequestOptions options = null)
=> ChannelHelper.FollowAnnouncementChannelAsync(this, channelId, Discord, options);
}
}