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.

RestGuildChannel.cs 8.2 kB

Add support for channel categories (#907) commit a85c5814a74e473e95fe172f0379cbc7f9f951d8 Author: Christopher F <computerizedtaco@gmail.com> Date: Sat Jan 6 22:25:48 2018 -0500 Code cleanup commit 4b243fd3dd99152b4ebc7ee01d704bd8e57eeee1 Author: Christopher F <computerizedtaco@gmail.com> Date: Sat Jan 6 22:08:28 2018 -0500 Add support for channel categories (#907) commit 41ed9106f2b05530acbf06b245c9aa618011d815 Author: mrspits4ever <spits.lucas@gmail.com> Date: Thu Dec 14 20:02:57 2017 +0100 removed mentioning support for RestCategoryChannel, added channels property to SocketCategoryChannel commit 71142c310847886dff80c49e9357dd0786d67a1b Merge: 4589d731 678a7238 Author: mrspits4ever <spits.lucas@gmail.com> Date: Wed Dec 13 21:17:53 2017 +0100 Merge branch 'dev' of https://github.com/RogueException/Discord.Net into feature/channel-categories commit 4589d73187871c98485ed25c6d223706927af7ec Author: mrspits4ever <spits.lucas@gmail.com> Date: Wed Dec 13 21:17:46 2017 +0100 adressed requested changes commit d59b038efa048b2279602e2015ddd2c185e58d63 Author: pegasy <pegasy@users.noreply.github.com> Date: Mon Sep 25 18:53:23 2017 +0200 Renamed classes / properties / methods to use CategoryChannel instead of ChannelCategory to be consistant with how text / voice channels are named. commit 5c4777dc8cc443108f2e7e4afae98824c9a32b1f Author: pegasy <pegasy@users.noreply.github.com> Date: Sun Sep 24 19:08:25 2017 +0200 removed Guild from class name for ChannelCategory Renamed all properties to use Category instead of Parent Throw exception on GetUsers / GetInvites etc for categories commit e18bd8c799d2327270021c05866cb2e97ad4671b Author: pegasy <pegasy@users.noreply.github.com> Date: Sun Sep 24 15:49:51 2017 +0200 Add support for channel categories (as its own channel type)
7 years ago
Add support for channel categories (#907) commit a85c5814a74e473e95fe172f0379cbc7f9f951d8 Author: Christopher F <computerizedtaco@gmail.com> Date: Sat Jan 6 22:25:48 2018 -0500 Code cleanup commit 4b243fd3dd99152b4ebc7ee01d704bd8e57eeee1 Author: Christopher F <computerizedtaco@gmail.com> Date: Sat Jan 6 22:08:28 2018 -0500 Add support for channel categories (#907) commit 41ed9106f2b05530acbf06b245c9aa618011d815 Author: mrspits4ever <spits.lucas@gmail.com> Date: Thu Dec 14 20:02:57 2017 +0100 removed mentioning support for RestCategoryChannel, added channels property to SocketCategoryChannel commit 71142c310847886dff80c49e9357dd0786d67a1b Merge: 4589d731 678a7238 Author: mrspits4ever <spits.lucas@gmail.com> Date: Wed Dec 13 21:17:53 2017 +0100 Merge branch 'dev' of https://github.com/RogueException/Discord.Net into feature/channel-categories commit 4589d73187871c98485ed25c6d223706927af7ec Author: mrspits4ever <spits.lucas@gmail.com> Date: Wed Dec 13 21:17:46 2017 +0100 adressed requested changes commit d59b038efa048b2279602e2015ddd2c185e58d63 Author: pegasy <pegasy@users.noreply.github.com> Date: Mon Sep 25 18:53:23 2017 +0200 Renamed classes / properties / methods to use CategoryChannel instead of ChannelCategory to be consistant with how text / voice channels are named. commit 5c4777dc8cc443108f2e7e4afae98824c9a32b1f Author: pegasy <pegasy@users.noreply.github.com> Date: Sun Sep 24 19:08:25 2017 +0200 removed Guild from class name for ChannelCategory Renamed all properties to use Category instead of Parent Throw exception on GetUsers / GetInvites etc for categories commit e18bd8c799d2327270021c05866cb2e97ad4671b Author: pegasy <pegasy@users.noreply.github.com> Date: Sun Sep 24 15:49:51 2017 +0200 Add support for channel categories (as its own channel type)
7 years ago
Add support for channel categories (#907) commit a85c5814a74e473e95fe172f0379cbc7f9f951d8 Author: Christopher F <computerizedtaco@gmail.com> Date: Sat Jan 6 22:25:48 2018 -0500 Code cleanup commit 4b243fd3dd99152b4ebc7ee01d704bd8e57eeee1 Author: Christopher F <computerizedtaco@gmail.com> Date: Sat Jan 6 22:08:28 2018 -0500 Add support for channel categories (#907) commit 41ed9106f2b05530acbf06b245c9aa618011d815 Author: mrspits4ever <spits.lucas@gmail.com> Date: Thu Dec 14 20:02:57 2017 +0100 removed mentioning support for RestCategoryChannel, added channels property to SocketCategoryChannel commit 71142c310847886dff80c49e9357dd0786d67a1b Merge: 4589d731 678a7238 Author: mrspits4ever <spits.lucas@gmail.com> Date: Wed Dec 13 21:17:53 2017 +0100 Merge branch 'dev' of https://github.com/RogueException/Discord.Net into feature/channel-categories commit 4589d73187871c98485ed25c6d223706927af7ec Author: mrspits4ever <spits.lucas@gmail.com> Date: Wed Dec 13 21:17:46 2017 +0100 adressed requested changes commit d59b038efa048b2279602e2015ddd2c185e58d63 Author: pegasy <pegasy@users.noreply.github.com> Date: Mon Sep 25 18:53:23 2017 +0200 Renamed classes / properties / methods to use CategoryChannel instead of ChannelCategory to be consistant with how text / voice channels are named. commit 5c4777dc8cc443108f2e7e4afae98824c9a32b1f Author: pegasy <pegasy@users.noreply.github.com> Date: Sun Sep 24 19:08:25 2017 +0200 removed Guild from class name for ChannelCategory Renamed all properties to use Category instead of Parent Throw exception on GetUsers / GetInvites etc for categories commit e18bd8c799d2327270021c05866cb2e97ad4671b Author: pegasy <pegasy@users.noreply.github.com> Date: Sun Sep 24 15:49:51 2017 +0200 Add support for channel categories (as its own channel type)
7 years ago
Add support for channel categories (#907) commit a85c5814a74e473e95fe172f0379cbc7f9f951d8 Author: Christopher F <computerizedtaco@gmail.com> Date: Sat Jan 6 22:25:48 2018 -0500 Code cleanup commit 4b243fd3dd99152b4ebc7ee01d704bd8e57eeee1 Author: Christopher F <computerizedtaco@gmail.com> Date: Sat Jan 6 22:08:28 2018 -0500 Add support for channel categories (#907) commit 41ed9106f2b05530acbf06b245c9aa618011d815 Author: mrspits4ever <spits.lucas@gmail.com> Date: Thu Dec 14 20:02:57 2017 +0100 removed mentioning support for RestCategoryChannel, added channels property to SocketCategoryChannel commit 71142c310847886dff80c49e9357dd0786d67a1b Merge: 4589d731 678a7238 Author: mrspits4ever <spits.lucas@gmail.com> Date: Wed Dec 13 21:17:53 2017 +0100 Merge branch 'dev' of https://github.com/RogueException/Discord.Net into feature/channel-categories commit 4589d73187871c98485ed25c6d223706927af7ec Author: mrspits4ever <spits.lucas@gmail.com> Date: Wed Dec 13 21:17:46 2017 +0100 adressed requested changes commit d59b038efa048b2279602e2015ddd2c185e58d63 Author: pegasy <pegasy@users.noreply.github.com> Date: Mon Sep 25 18:53:23 2017 +0200 Renamed classes / properties / methods to use CategoryChannel instead of ChannelCategory to be consistant with how text / voice channels are named. commit 5c4777dc8cc443108f2e7e4afae98824c9a32b1f Author: pegasy <pegasy@users.noreply.github.com> Date: Sun Sep 24 19:08:25 2017 +0200 removed Guild from class name for ChannelCategory Renamed all properties to use Category instead of Parent Throw exception on GetUsers / GetInvites etc for categories commit e18bd8c799d2327270021c05866cb2e97ad4671b Author: pegasy <pegasy@users.noreply.github.com> Date: Sun Sep 24 15:49:51 2017 +0200 Add support for channel categories (as its own channel type)
7 years ago
Add support for channel categories (#907) commit a85c5814a74e473e95fe172f0379cbc7f9f951d8 Author: Christopher F <computerizedtaco@gmail.com> Date: Sat Jan 6 22:25:48 2018 -0500 Code cleanup commit 4b243fd3dd99152b4ebc7ee01d704bd8e57eeee1 Author: Christopher F <computerizedtaco@gmail.com> Date: Sat Jan 6 22:08:28 2018 -0500 Add support for channel categories (#907) commit 41ed9106f2b05530acbf06b245c9aa618011d815 Author: mrspits4ever <spits.lucas@gmail.com> Date: Thu Dec 14 20:02:57 2017 +0100 removed mentioning support for RestCategoryChannel, added channels property to SocketCategoryChannel commit 71142c310847886dff80c49e9357dd0786d67a1b Merge: 4589d731 678a7238 Author: mrspits4ever <spits.lucas@gmail.com> Date: Wed Dec 13 21:17:53 2017 +0100 Merge branch 'dev' of https://github.com/RogueException/Discord.Net into feature/channel-categories commit 4589d73187871c98485ed25c6d223706927af7ec Author: mrspits4ever <spits.lucas@gmail.com> Date: Wed Dec 13 21:17:46 2017 +0100 adressed requested changes commit d59b038efa048b2279602e2015ddd2c185e58d63 Author: pegasy <pegasy@users.noreply.github.com> Date: Mon Sep 25 18:53:23 2017 +0200 Renamed classes / properties / methods to use CategoryChannel instead of ChannelCategory to be consistant with how text / voice channels are named. commit 5c4777dc8cc443108f2e7e4afae98824c9a32b1f Author: pegasy <pegasy@users.noreply.github.com> Date: Sun Sep 24 19:08:25 2017 +0200 removed Guild from class name for ChannelCategory Renamed all properties to use Category instead of Parent Throw exception on GetUsers / GetInvites etc for categories commit e18bd8c799d2327270021c05866cb2e97ad4671b Author: pegasy <pegasy@users.noreply.github.com> Date: Sun Sep 24 15:49:51 2017 +0200 Add support for channel categories (as its own channel type)
7 years ago
Add support for channel categories (#907) commit a85c5814a74e473e95fe172f0379cbc7f9f951d8 Author: Christopher F <computerizedtaco@gmail.com> Date: Sat Jan 6 22:25:48 2018 -0500 Code cleanup commit 4b243fd3dd99152b4ebc7ee01d704bd8e57eeee1 Author: Christopher F <computerizedtaco@gmail.com> Date: Sat Jan 6 22:08:28 2018 -0500 Add support for channel categories (#907) commit 41ed9106f2b05530acbf06b245c9aa618011d815 Author: mrspits4ever <spits.lucas@gmail.com> Date: Thu Dec 14 20:02:57 2017 +0100 removed mentioning support for RestCategoryChannel, added channels property to SocketCategoryChannel commit 71142c310847886dff80c49e9357dd0786d67a1b Merge: 4589d731 678a7238 Author: mrspits4ever <spits.lucas@gmail.com> Date: Wed Dec 13 21:17:53 2017 +0100 Merge branch 'dev' of https://github.com/RogueException/Discord.Net into feature/channel-categories commit 4589d73187871c98485ed25c6d223706927af7ec Author: mrspits4ever <spits.lucas@gmail.com> Date: Wed Dec 13 21:17:46 2017 +0100 adressed requested changes commit d59b038efa048b2279602e2015ddd2c185e58d63 Author: pegasy <pegasy@users.noreply.github.com> Date: Mon Sep 25 18:53:23 2017 +0200 Renamed classes / properties / methods to use CategoryChannel instead of ChannelCategory to be consistant with how text / voice channels are named. commit 5c4777dc8cc443108f2e7e4afae98824c9a32b1f Author: pegasy <pegasy@users.noreply.github.com> Date: Sun Sep 24 19:08:25 2017 +0200 removed Guild from class name for ChannelCategory Renamed all properties to use Category instead of Parent Throw exception on GetUsers / GetInvites etc for categories commit e18bd8c799d2327270021c05866cb2e97ad4671b Author: pegasy <pegasy@users.noreply.github.com> Date: Sun Sep 24 15:49:51 2017 +0200 Add support for channel categories (as its own channel type)
7 years ago
Add support for channel categories (#907) commit a85c5814a74e473e95fe172f0379cbc7f9f951d8 Author: Christopher F <computerizedtaco@gmail.com> Date: Sat Jan 6 22:25:48 2018 -0500 Code cleanup commit 4b243fd3dd99152b4ebc7ee01d704bd8e57eeee1 Author: Christopher F <computerizedtaco@gmail.com> Date: Sat Jan 6 22:08:28 2018 -0500 Add support for channel categories (#907) commit 41ed9106f2b05530acbf06b245c9aa618011d815 Author: mrspits4ever <spits.lucas@gmail.com> Date: Thu Dec 14 20:02:57 2017 +0100 removed mentioning support for RestCategoryChannel, added channels property to SocketCategoryChannel commit 71142c310847886dff80c49e9357dd0786d67a1b Merge: 4589d731 678a7238 Author: mrspits4ever <spits.lucas@gmail.com> Date: Wed Dec 13 21:17:53 2017 +0100 Merge branch 'dev' of https://github.com/RogueException/Discord.Net into feature/channel-categories commit 4589d73187871c98485ed25c6d223706927af7ec Author: mrspits4ever <spits.lucas@gmail.com> Date: Wed Dec 13 21:17:46 2017 +0100 adressed requested changes commit d59b038efa048b2279602e2015ddd2c185e58d63 Author: pegasy <pegasy@users.noreply.github.com> Date: Mon Sep 25 18:53:23 2017 +0200 Renamed classes / properties / methods to use CategoryChannel instead of ChannelCategory to be consistant with how text / voice channels are named. commit 5c4777dc8cc443108f2e7e4afae98824c9a32b1f Author: pegasy <pegasy@users.noreply.github.com> Date: Sun Sep 24 19:08:25 2017 +0200 removed Guild from class name for ChannelCategory Renamed all properties to use Category instead of Parent Throw exception on GetUsers / GetInvites etc for categories commit e18bd8c799d2327270021c05866cb2e97ad4671b Author: pegasy <pegasy@users.noreply.github.com> Date: Sun Sep 24 15:49:51 2017 +0200 Add support for channel categories (as its own channel type)
7 years ago
Add support for channel categories (#907) commit a85c5814a74e473e95fe172f0379cbc7f9f951d8 Author: Christopher F <computerizedtaco@gmail.com> Date: Sat Jan 6 22:25:48 2018 -0500 Code cleanup commit 4b243fd3dd99152b4ebc7ee01d704bd8e57eeee1 Author: Christopher F <computerizedtaco@gmail.com> Date: Sat Jan 6 22:08:28 2018 -0500 Add support for channel categories (#907) commit 41ed9106f2b05530acbf06b245c9aa618011d815 Author: mrspits4ever <spits.lucas@gmail.com> Date: Thu Dec 14 20:02:57 2017 +0100 removed mentioning support for RestCategoryChannel, added channels property to SocketCategoryChannel commit 71142c310847886dff80c49e9357dd0786d67a1b Merge: 4589d731 678a7238 Author: mrspits4ever <spits.lucas@gmail.com> Date: Wed Dec 13 21:17:53 2017 +0100 Merge branch 'dev' of https://github.com/RogueException/Discord.Net into feature/channel-categories commit 4589d73187871c98485ed25c6d223706927af7ec Author: mrspits4ever <spits.lucas@gmail.com> Date: Wed Dec 13 21:17:46 2017 +0100 adressed requested changes commit d59b038efa048b2279602e2015ddd2c185e58d63 Author: pegasy <pegasy@users.noreply.github.com> Date: Mon Sep 25 18:53:23 2017 +0200 Renamed classes / properties / methods to use CategoryChannel instead of ChannelCategory to be consistant with how text / voice channels are named. commit 5c4777dc8cc443108f2e7e4afae98824c9a32b1f Author: pegasy <pegasy@users.noreply.github.com> Date: Sun Sep 24 19:08:25 2017 +0200 removed Guild from class name for ChannelCategory Renamed all properties to use Category instead of Parent Throw exception on GetUsers / GetInvites etc for categories commit e18bd8c799d2327270021c05866cb2e97ad4671b Author: pegasy <pegasy@users.noreply.github.com> Date: Sun Sep 24 15:49:51 2017 +0200 Add support for channel categories (as its own channel type)
7 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.Immutable;
  4. using System.Linq;
  5. using System.Threading.Tasks;
  6. using Model = Discord.API.Channel;
  7. namespace Discord.Rest
  8. {
  9. public class RestGuildChannel : RestChannel, IGuildChannel
  10. {
  11. private ImmutableArray<Overwrite> _overwrites;
  12. public IReadOnlyCollection<Overwrite> PermissionOverwrites => _overwrites;
  13. internal IGuild Guild { get; }
  14. public string Name { get; private set; }
  15. public int Position { get; private set; }
  16. public ulong GuildId => Guild.Id;
  17. internal RestGuildChannel(BaseDiscordClient discord, IGuild guild, ulong id)
  18. : base(discord, id)
  19. {
  20. Guild = guild;
  21. }
  22. internal static RestGuildChannel Create(BaseDiscordClient discord, IGuild guild, Model model)
  23. {
  24. switch (model.Type)
  25. {
  26. case ChannelType.Text:
  27. return RestTextChannel.Create(discord, guild, model);
  28. case ChannelType.Voice:
  29. return RestVoiceChannel.Create(discord, guild, model);
  30. case ChannelType.Category:
  31. return RestCategoryChannel.Create(discord, guild, model);
  32. default:
  33. return new RestGuildChannel(discord, guild, model.Id);
  34. }
  35. }
  36. internal override void Update(Model model)
  37. {
  38. Name = model.Name.Value;
  39. Position = model.Position.Value;
  40. var overwrites = model.PermissionOverwrites.Value;
  41. var newOverwrites = ImmutableArray.CreateBuilder<Overwrite>(overwrites.Length);
  42. for (int i = 0; i < overwrites.Length; i++)
  43. newOverwrites.Add(overwrites[i].ToEntity());
  44. _overwrites = newOverwrites.ToImmutable();
  45. }
  46. public override async Task UpdateAsync(RequestOptions options = null)
  47. {
  48. var model = await Discord.ApiClient.GetChannelAsync(GuildId, Id, options).ConfigureAwait(false);
  49. Update(model);
  50. }
  51. public async Task ModifyAsync(Action<GuildChannelProperties> func, RequestOptions options = null)
  52. {
  53. var model = await ChannelHelper.ModifyAsync(this, Discord, func, options).ConfigureAwait(false);
  54. Update(model);
  55. }
  56. public Task DeleteAsync(RequestOptions options = null)
  57. => ChannelHelper.DeleteAsync(this, Discord, options);
  58. public OverwritePermissions? GetPermissionOverwrite(IUser user)
  59. {
  60. for (int i = 0; i < _overwrites.Length; i++)
  61. {
  62. if (_overwrites[i].TargetId == user.Id)
  63. return _overwrites[i].Permissions;
  64. }
  65. return null;
  66. }
  67. public OverwritePermissions? GetPermissionOverwrite(IRole role)
  68. {
  69. for (int i = 0; i < _overwrites.Length; i++)
  70. {
  71. if (_overwrites[i].TargetId == role.Id)
  72. return _overwrites[i].Permissions;
  73. }
  74. return null;
  75. }
  76. public async Task AddPermissionOverwriteAsync(IUser user, OverwritePermissions perms, RequestOptions options = null)
  77. {
  78. await ChannelHelper.AddPermissionOverwriteAsync(this, Discord, user, perms, options).ConfigureAwait(false);
  79. _overwrites = _overwrites.Add(new Overwrite(user.Id, PermissionTarget.User, new OverwritePermissions(perms.AllowValue, perms.DenyValue)));
  80. }
  81. public async Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions perms, RequestOptions options = null)
  82. {
  83. await ChannelHelper.AddPermissionOverwriteAsync(this, Discord, role, perms, options).ConfigureAwait(false);
  84. _overwrites = _overwrites.Add(new Overwrite(role.Id, PermissionTarget.Role, new OverwritePermissions(perms.AllowValue, perms.DenyValue)));
  85. }
  86. public async Task RemovePermissionOverwriteAsync(IUser user, RequestOptions options = null)
  87. {
  88. await ChannelHelper.RemovePermissionOverwriteAsync(this, Discord, user, options).ConfigureAwait(false);
  89. for (int i = 0; i < _overwrites.Length; i++)
  90. {
  91. if (_overwrites[i].TargetId == user.Id)
  92. {
  93. _overwrites = _overwrites.RemoveAt(i);
  94. return;
  95. }
  96. }
  97. }
  98. public async Task RemovePermissionOverwriteAsync(IRole role, RequestOptions options = null)
  99. {
  100. await ChannelHelper.RemovePermissionOverwriteAsync(this, Discord, role, options).ConfigureAwait(false);
  101. for (int i = 0; i < _overwrites.Length; i++)
  102. {
  103. if (_overwrites[i].TargetId == role.Id)
  104. {
  105. _overwrites = _overwrites.RemoveAt(i);
  106. return;
  107. }
  108. }
  109. }
  110. public async Task<IReadOnlyCollection<RestInviteMetadata>> GetInvitesAsync(RequestOptions options = null)
  111. => await ChannelHelper.GetInvitesAsync(this, Discord, options).ConfigureAwait(false);
  112. public async Task<RestInviteMetadata> CreateInviteAsync(int? maxAge = 86400, int? maxUses = null, bool isTemporary = false, bool isUnique = false, RequestOptions options = null)
  113. => await ChannelHelper.CreateInviteAsync(this, Discord, maxAge, maxUses, isTemporary, isUnique, options).ConfigureAwait(false);
  114. public override string ToString() => Name;
  115. //IGuildChannel
  116. IGuild IGuildChannel.Guild
  117. {
  118. get
  119. {
  120. if (Guild != null)
  121. return Guild;
  122. throw new InvalidOperationException("Unable to return this entity's parent unless it was fetched through that object.");
  123. }
  124. }
  125. async Task<IReadOnlyCollection<IInviteMetadata>> IGuildChannel.GetInvitesAsync(RequestOptions options)
  126. => await GetInvitesAsync(options).ConfigureAwait(false);
  127. async Task<IInviteMetadata> IGuildChannel.CreateInviteAsync(int? maxAge, int? maxUses, bool isTemporary, bool isUnique, RequestOptions options)
  128. => await CreateInviteAsync(maxAge, maxUses, isTemporary, isUnique, options).ConfigureAwait(false);
  129. OverwritePermissions? IGuildChannel.GetPermissionOverwrite(IRole role)
  130. => GetPermissionOverwrite(role);
  131. OverwritePermissions? IGuildChannel.GetPermissionOverwrite(IUser user)
  132. => GetPermissionOverwrite(user);
  133. async Task IGuildChannel.AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options)
  134. => await AddPermissionOverwriteAsync(role, permissions, options).ConfigureAwait(false);
  135. async Task IGuildChannel.AddPermissionOverwriteAsync(IUser user, OverwritePermissions permissions, RequestOptions options)
  136. => await AddPermissionOverwriteAsync(user, permissions, options).ConfigureAwait(false);
  137. async Task IGuildChannel.RemovePermissionOverwriteAsync(IRole role, RequestOptions options)
  138. => await RemovePermissionOverwriteAsync(role, options).ConfigureAwait(false);
  139. async Task IGuildChannel.RemovePermissionOverwriteAsync(IUser user, RequestOptions options)
  140. => await RemovePermissionOverwriteAsync(user, options).ConfigureAwait(false);
  141. IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> IGuildChannel.GetUsersAsync(CacheMode mode, RequestOptions options)
  142. => AsyncEnumerable.Empty<IReadOnlyCollection<IGuildUser>>(); //Overridden //Overridden in Text/Voice
  143. Task<IGuildUser> IGuildChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
  144. => Task.FromResult<IGuildUser>(null); //Overridden in Text/Voice
  145. //IChannel
  146. IAsyncEnumerable<IReadOnlyCollection<IUser>> IChannel.GetUsersAsync(CacheMode mode, RequestOptions options)
  147. => AsyncEnumerable.Empty<IReadOnlyCollection<IUser>>(); //Overridden in Text/Voice
  148. Task<IUser> IChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
  149. => Task.FromResult<IUser>(null); //Overridden in Text/Voice
  150. }
  151. }