Replace IEnumerable with IReadonlyCollection where possible
This commit is contained in:
@@ -8,25 +8,25 @@ namespace Discord.WebSocket.Extensions
|
|||||||
public static IUser GetUser(this IDMChannel channel, ulong id)
|
public static IUser GetUser(this IDMChannel channel, ulong id)
|
||||||
=> GetSocketDMChannel(channel).GetUser(id);
|
=> GetSocketDMChannel(channel).GetUser(id);
|
||||||
|
|
||||||
public static IEnumerable<IUser> GetUsers(this IDMChannel channel)
|
public static IReadOnlyCollection<IUser> GetUsers(this IDMChannel channel)
|
||||||
=> GetSocketDMChannel(channel).Users;
|
=> GetSocketDMChannel(channel).Users;
|
||||||
|
|
||||||
public static IUser GetUser(this IGroupChannel channel, ulong id)
|
public static IUser GetUser(this IGroupChannel channel, ulong id)
|
||||||
=> GetSocketGroupChannel(channel).GetUser(id);
|
=> GetSocketGroupChannel(channel).GetUser(id);
|
||||||
|
|
||||||
public static IEnumerable<IUser> GetUsers(this IGroupChannel channel)
|
public static IReadOnlyCollection<IUser> GetUsers(this IGroupChannel channel)
|
||||||
=> GetSocketGroupChannel(channel).Users;
|
=> GetSocketGroupChannel(channel).Users;
|
||||||
|
|
||||||
public static IGuildUser GetUser(this ITextChannel channel, ulong id)
|
public static IGuildUser GetUser(this ITextChannel channel, ulong id)
|
||||||
=> GetSocketTextChannel(channel).GetUser(id);
|
=> GetSocketTextChannel(channel).GetUser(id);
|
||||||
|
|
||||||
public static IEnumerable<IGuildUser> GetUsers(this ITextChannel channel)
|
public static IReadOnlyCollection<IGuildUser> GetUsers(this ITextChannel channel)
|
||||||
=> GetSocketTextChannel(channel).Members;
|
=> GetSocketTextChannel(channel).Members;
|
||||||
|
|
||||||
public static IGuildUser GetUser(this IVoiceChannel channel, ulong id)
|
public static IGuildUser GetUser(this IVoiceChannel channel, ulong id)
|
||||||
=> GetSocketVoiceChannel(channel).GetUser(id);
|
=> GetSocketVoiceChannel(channel).GetUser(id);
|
||||||
|
|
||||||
public static IEnumerable<IGuildUser> GetUsers(this IVoiceChannel channel)
|
public static IReadOnlyCollection<IGuildUser> GetUsers(this IVoiceChannel channel)
|
||||||
=> GetSocketVoiceChannel(channel).Members;
|
=> GetSocketVoiceChannel(channel).Members;
|
||||||
|
|
||||||
internal static SocketDMChannel GetSocketDMChannel(IDMChannel channel)
|
internal static SocketDMChannel GetSocketDMChannel(IDMChannel channel)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Discord.WebSocket.Extensions
|
|||||||
public static IGuildChannel GetChannel(this IGuild guild, ulong id) =>
|
public static IGuildChannel GetChannel(this IGuild guild, ulong id) =>
|
||||||
GetSocketGuild(guild).GetChannel(id);
|
GetSocketGuild(guild).GetChannel(id);
|
||||||
|
|
||||||
public static IEnumerable<IGuildChannel> GetChannels(this IGuild guild) =>
|
public static IReadOnlyCollection<IGuildChannel> GetChannels(this IGuild guild) =>
|
||||||
GetSocketGuild(guild).Channels;
|
GetSocketGuild(guild).Channels;
|
||||||
|
|
||||||
public static ITextChannel GetTextChannel(this IGuild guild, ulong id) =>
|
public static ITextChannel GetTextChannel(this IGuild guild, ulong id) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user