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.

SocketNewsChannel.cs 2.4 kB

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