Skip to content

Commit

Permalink
Merge pull request #13 from foldingcash/dev
Browse files Browse the repository at this point in the history
show disabled commands to admin
  • Loading branch information
StrungSafe authored Jul 22, 2024
2 parents 3839265 + 47a98f4 commit 732c118
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions DiscordBot/DiscordBot.Core/BaseModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,23 @@ private string Usage(SocketCommandContext context)
var usageAttribute =
command.Attributes.FirstOrDefault(attribute => attribute is UsageAttribute) as UsageAttribute;

builder.Append("\t");

if(botConfigurationService.DisabledCommandsContains(command.Name))
{
builder.Append("(Disabled) ");
}

if (usageAttribute is default(UsageAttribute))
{
builder.AppendLine($"\t{command.Name} - {command.Summary}");
builder.Append($"{command.Name} - {command.Summary}");
}
else
{
builder.AppendLine($"\t{command.Name} {usageAttribute.Usage} - {command.Summary}");
builder.Append($"{command.Name} {usageAttribute.Usage} - {command.Summary}");
}

builder.AppendLine();
}

return builder.ToString();
Expand Down

0 comments on commit 732c118

Please sign in to comment.