lint: Initial clean-up (#1181)
This commit is contained in:
@@ -11,9 +11,13 @@ namespace Discord.Commands
|
|||||||
{
|
{
|
||||||
var executableCommands = new List<CommandInfo>();
|
var executableCommands = new List<CommandInfo>();
|
||||||
|
|
||||||
var tasks = commands.Select(async c => { var result = await c.CheckPreconditionsAsync(context, provider).ConfigureAwait(false); return new { Command = c, PreconditionResult = result }; });
|
var tasks = commands.Select(async c =>
|
||||||
|
{
|
||||||
|
var result = await c.CheckPreconditionsAsync(context, provider).ConfigureAwait(false);
|
||||||
|
return new { Command = c, PreconditionResult = result };
|
||||||
|
});
|
||||||
|
|
||||||
var results = await Task.WhenAll(tasks);
|
var results = await Task.WhenAll(tasks).ConfigureAwait(false);
|
||||||
|
|
||||||
foreach (var result in results)
|
foreach (var result in results)
|
||||||
{
|
{
|
||||||
@@ -32,7 +36,7 @@ namespace Discord.Commands
|
|||||||
executableCommands.AddRange(await module.Commands.ToArray().GetExecutableCommandsAsync(context, provider).ConfigureAwait(false));
|
executableCommands.AddRange(await module.Commands.ToArray().GetExecutableCommandsAsync(context, provider).ConfigureAwait(false));
|
||||||
|
|
||||||
var tasks = module.Submodules.Select(async s => await s.GetExecutableCommandsAsync(context, provider).ConfigureAwait(false));
|
var tasks = module.Submodules.Select(async s => await s.GetExecutableCommandsAsync(context, provider).ConfigureAwait(false));
|
||||||
var results = await Task.WhenAll(tasks);
|
var results = await Task.WhenAll(tasks).ConfigureAwait(false);
|
||||||
|
|
||||||
executableCommands.AddRange(results.SelectMany(c => c));
|
executableCommands.AddRange(results.SelectMany(c => c));
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Immutable;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -37,8 +38,8 @@ namespace Discord.WebSocket
|
|||||||
public IActivity Activity => Presence.Activity;
|
public IActivity Activity => Presence.Activity;
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public UserStatus Status => Presence.Status;
|
public UserStatus Status => Presence.Status;
|
||||||
public IEnumerable<SocketGuild> MutualGuilds
|
public IReadOnlyCollection<SocketGuild> MutualGuilds
|
||||||
=> Discord.Guilds.Where(g => g.Users.Any(u => u.Id == Id));
|
=> Discord.Guilds.Where(g => g.Users.Any(u => u.Id == Id)).ToImmutableArray();
|
||||||
|
|
||||||
internal SocketUser(DiscordSocketClient discord, ulong id)
|
internal SocketUser(DiscordSocketClient discord, ulong id)
|
||||||
: base(discord, id)
|
: base(discord, id)
|
||||||
|
|||||||
Reference in New Issue
Block a user