closes #431, if gmod or gcmd is active on some module or command, they won't show up on -mdls or -cmds respectively

This commit is contained in:
Kwoth 2017-04-09 23:22:06 +02:00
parent 98c330d6a6
commit 19160c6bbc
4 changed files with 5 additions and 3 deletions

View File

@ -31,6 +31,7 @@ namespace NadekoBot.Modules.Help
.WithTitle(GetText("list_of_modules")) .WithTitle(GetText("list_of_modules"))
.WithDescription(string.Join("\n", .WithDescription(string.Join("\n",
NadekoBot.CommandService.Modules.GroupBy(m => m.GetTopLevelModule()) NadekoBot.CommandService.Modules.GroupBy(m => m.GetTopLevelModule())
.Where(m => !Permissions.Permissions.GlobalPermissionCommands.BlockedModules.Contains(m.Key.Name.ToLowerInvariant()))
.Select(m => "• " + m.Key.Name) .Select(m => "• " + m.Key.Name)
.OrderBy(s => s))); .OrderBy(s => s)));
await Context.Channel.EmbedAsync(embed).ConfigureAwait(false); await Context.Channel.EmbedAsync(embed).ConfigureAwait(false);
@ -45,6 +46,7 @@ namespace NadekoBot.Modules.Help
if (string.IsNullOrWhiteSpace(module)) if (string.IsNullOrWhiteSpace(module))
return; return;
var cmds = NadekoBot.CommandService.Commands.Where(c => c.Module.GetTopLevelModule().Name.ToUpperInvariant().StartsWith(module)) var cmds = NadekoBot.CommandService.Commands.Where(c => c.Module.GetTopLevelModule().Name.ToUpperInvariant().StartsWith(module))
.Where(c => !Permissions.Permissions.GlobalPermissionCommands.BlockedCommands.Contains(c.Aliases.First().ToLowerInvariant()))
.OrderBy(c => c.Aliases.First()) .OrderBy(c => c.Aliases.First())
.Distinct(new CommandTextEqualityComparer()) .Distinct(new CommandTextEqualityComparer())
.AsEnumerable(); .AsEnumerable();

View File

@ -585,7 +585,7 @@ namespace NadekoBot.Modules.Searches
{ {
if (usr == null) if (usr == null)
usr = Context.User; usr = Context.User;
await Context.Channel.SendConfirmAsync($"https://images.google.com/searchbyimage?image_url={usr.AvatarUrl}").ConfigureAwait(false); await Context.Channel.SendConfirmAsync($"https://images.google.com/searchbyimage?image_url={usr.RealAvatarUrl()}").ConfigureAwait(false);
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]

View File

@ -5037,7 +5037,7 @@ namespace NadekoBot.Resources {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Mentions every person from the provided role or roles (separated by a &apos;,&apos;) on this server. Requires you to have the mention everyone permission.. /// Looks up a localized string similar to Mentions every person from the provided role or roles (separated by a &apos;,&apos;) on this server..
/// </summary> /// </summary>
public static string mentionrole_desc { public static string mentionrole_desc {
get { get {

View File

@ -733,7 +733,7 @@
<value>mentionrole menro</value> <value>mentionrole menro</value>
</data> </data>
<data name="mentionrole_desc" xml:space="preserve"> <data name="mentionrole_desc" xml:space="preserve">
<value>Mentions every person from the provided role or roles (separated by a ',') on this server. Requires you to have the mention everyone permission.</value> <value>Mentions every person from the provided role or roles (separated by a ',') on this server.</value>
</data> </data>
<data name="mentionrole_usage" xml:space="preserve"> <data name="mentionrole_usage" xml:space="preserve">
<value>`{0}menro RoleName`</value> <value>`{0}menro RoleName`</value>