You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

RestNewsChannel.cs 2.4 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using Model = Discord.API.Channel;
  8. namespace Discord.Rest
  9. {
  10. /// <summary>
  11. /// Represents a REST-based news channel in a guild that has the same properties as a <see cref="RestTextChannel"/>.
  12. /// </summary>
  13. [DebuggerDisplay(@"{DebuggerDisplay,nq}")]
  14. public class RestNewsChannel : RestTextChannel
  15. {
  16. internal RestNewsChannel(BaseDiscordClient discord, IGuild guild, ulong id)
  17. :base(discord, guild, id)
  18. {
  19. }
  20. internal new static RestNewsChannel Create(BaseDiscordClient discord, IGuild guild, Model model)
  21. {
  22. var entity = new RestNewsChannel(discord, guild, model.Id);
  23. entity.Update(model);
  24. return entity;
  25. }
  26. public override int SlowModeInterval => throw new NotSupportedException("News channels do not support Slow Mode.");
  27. public override Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null)
  28. {
  29. throw new NotSupportedException("News channels do not support Overwrite Permissions.");
  30. }
  31. public override Task AddPermissionOverwriteAsync(IUser user, OverwritePermissions permissions, RequestOptions options = null)
  32. {
  33. throw new NotSupportedException("News channels do not support Overwrite Permissions.");
  34. }
  35. public override OverwritePermissions? GetPermissionOverwrite(IRole role)
  36. {
  37. throw new NotSupportedException("News channels do not support Overwrite Permissions.");
  38. }
  39. public override OverwritePermissions? GetPermissionOverwrite(IUser user)
  40. {
  41. throw new NotSupportedException("News channels do not support Overwrite Permissions.");
  42. }
  43. public override Task RemovePermissionOverwriteAsync(IRole role, RequestOptions options = null)
  44. {
  45. throw new NotSupportedException("News channels do not support Overwrite Permissions.");
  46. }
  47. public override Task RemovePermissionOverwriteAsync(IUser user, RequestOptions options = null)
  48. {
  49. throw new NotSupportedException("News channels do not support Overwrite Permissions.");
  50. }
  51. }
  52. }