Browse Source

Modified help to not give redudent info.

tags/3.0.2
Teknikode 4 years ago
parent
commit
535f0bc262
1 changed files with 32 additions and 2 deletions
  1. 32
    2
      Modules/Help/Help.cs

+ 32
- 2
Modules/Help/Help.cs View File

@@ -67,6 +67,8 @@ namespace Combot.Modules.Plugins
Bot.IRC.Command.SendNotice(command.Nick.Nickname, string.Format("{0}", foundCommand.Description));
}
Bot.IRC.Command.SendNotice(command.Nick.Nickname, "\u200B");
Dictionary<string, string> argDescriptions = new Dictionary<string, string>();
int index = 0;
for (int i = 0; i < foundCommand.AllowedMessageTypes.Count; i++)
{
MessageType messageType = foundCommand.AllowedMessageTypes[i];
@@ -127,14 +129,42 @@ namespace Combot.Modules.Plugins
{
commandDesc = string.Format(" - {0}", arg.Description);
}
Bot.IRC.Command.SendNotice(command.Nick.Nickname, string.Format("\t\t\u0002{0}\u0002{1}", arg.Name, commandDesc));
if (!argDescriptions.ContainsKey(arg.Name))
{
argDescriptions.Add(arg.Name, string.Format("\t\t\u0002{0}\u0002{1}", arg.Name, commandDesc));
}
if (arg.AllowedValues.Count > 0)
{
Bot.IRC.Command.SendNotice(command.Nick.Nickname, string.Format("\t\t\t\tAllowed Values: \u0002{0}\u0002", string.Join(", ", arg.AllowedValues)));
string argAllowed = string.Format("\t\t\t\tAllowed Values: \u0002{0}\u0002", string.Join(", ", arg.AllowedValues));
bool containsAllowed = false;
for (int x = 0; x < index; x++)
{
if (argDescriptions.ContainsKey(arg.Name + " - Allowed Values " + x))
{
if (argDescriptions[arg.Name + " - Allowed Values " + x] == argAllowed)
{
containsAllowed = true;
break;
}
}
}
if (!containsAllowed)
{
argDescriptions.Add(arg.Name + " - Allowed Values " + index, argAllowed);
index++;
}
}
});
}
}
Bot.IRC.Command.SendNotice(command.Nick.Nickname, "\u200B");
if (argDescriptions.Count > 0)
{
foreach (KeyValuePair<string, string> argDescription in argDescriptions)
{
Bot.IRC.Command.SendNotice(command.Nick.Nickname, argDescription.Value);
}
}
}
else
{

Loading…
Cancel
Save