Add SocketUser.MutualGuilds + various command ext. methods. (#1037)

* Add SocketUser.MutualGuilds + various ext. methods.

* Search through submodules for GetExecutableCommandAsync

* Allow GetExecutableCommandsAsync(ModuleInfo) to recurse properly to all submodules.

* Bump down lang. version & whitespace cleanup.

* Change to use Task.WhenAll

* Change to ICollection<CommandInfo>

* Resolve build errors.
This commit is contained in:
Alex Gravely
2018-10-20 14:40:13 -04:00
committed by Christopher F
parent 649a779c23
commit 637d9fc794
3 changed files with 59 additions and 1 deletions

View File

@@ -1,7 +1,9 @@
using Discord.Rest;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Discord.Rest;
using Model = Discord.API.User;
namespace Discord.WebSocket
@@ -35,6 +37,8 @@ namespace Discord.WebSocket
public IActivity Activity => Presence.Activity;
/// <inheritdoc />
public UserStatus Status => Presence.Status;
public IEnumerable<SocketGuild> MutualGuilds
=> Discord.Guilds.Where(g => g.Users.Any(u => u.Id == Id));
internal SocketUser(DiscordSocketClient discord, ulong id)
: base(discord, id)