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)
|
||||
=> GetSocketDMChannel(channel).GetUser(id);
|
||||
|
||||
public static IEnumerable<IUser> GetUsers(this IDMChannel channel)
|
||||
public static IReadOnlyCollection<IUser> GetUsers(this IDMChannel channel)
|
||||
=> GetSocketDMChannel(channel).Users;
|
||||
|
||||
public static IUser GetUser(this IGroupChannel channel, ulong id)
|
||||
=> GetSocketGroupChannel(channel).GetUser(id);
|
||||
|
||||
public static IEnumerable<IUser> GetUsers(this IGroupChannel channel)
|
||||
public static IReadOnlyCollection<IUser> GetUsers(this IGroupChannel channel)
|
||||
=> GetSocketGroupChannel(channel).Users;
|
||||
|
||||
public static IGuildUser GetUser(this ITextChannel channel, ulong id)
|
||||
=> GetSocketTextChannel(channel).GetUser(id);
|
||||
|
||||
public static IEnumerable<IGuildUser> GetUsers(this ITextChannel channel)
|
||||
public static IReadOnlyCollection<IGuildUser> GetUsers(this ITextChannel channel)
|
||||
=> GetSocketTextChannel(channel).Members;
|
||||
|
||||
public static IGuildUser GetUser(this IVoiceChannel channel, ulong id)
|
||||
=> GetSocketVoiceChannel(channel).GetUser(id);
|
||||
|
||||
public static IEnumerable<IGuildUser> GetUsers(this IVoiceChannel channel)
|
||||
public static IReadOnlyCollection<IGuildUser> GetUsers(this IVoiceChannel channel)
|
||||
=> GetSocketVoiceChannel(channel).Members;
|
||||
|
||||
internal static SocketDMChannel GetSocketDMChannel(IDMChannel channel)
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Discord.WebSocket.Extensions
|
||||
public static IGuildChannel GetChannel(this IGuild guild, ulong id) =>
|
||||
GetSocketGuild(guild).GetChannel(id);
|
||||
|
||||
public static IEnumerable<IGuildChannel> GetChannels(this IGuild guild) =>
|
||||
public static IReadOnlyCollection<IGuildChannel> GetChannels(this IGuild guild) =>
|
||||
GetSocketGuild(guild).Channels;
|
||||
|
||||
public static ITextChannel GetTextChannel(this IGuild guild, ulong id) =>
|
||||
|
||||
Reference in New Issue
Block a user