Usages and descriptions now show correct prefixes if they have been changed

This commit is contained in:
Kwoth 2016-10-19 16:34:04 +02:00
parent ac45df0c2a
commit dab26cf3c5

View File

@ -100,8 +100,8 @@ namespace NadekoBot.Modules.Help
if (alias != null)
str += $" / `{alias}`";
if (com != null)
await channel.SendMessageAsync(str + $@"{Environment.NewLine}**Desc:** {com.Summary} {GetCommandRequirements(com)}
**Usage:** {com.Remarks}").ConfigureAwait(false);
await channel.SendMessageAsync(str + $@"{Environment.NewLine}**Desc:** {string.Format(com.Summary, com.Module.Prefix)} {GetCommandRequirements(com)}
**Usage:** {string.Format(com.Remarks, com.Module.Prefix)}").ConfigureAwait(false);
}
private string GetCommandRequirements(Command cmd)
@ -136,7 +136,7 @@ namespace NadekoBot.Modules.Help
helpstr.AppendLine("----------------|--------------|-------");
lastModule = com.Module.Name;
}
helpstr.AppendLine($"`{com.Text}` {string.Join(" ", com.Aliases.Skip(1).Select(a=>"`"+a+"`"))} | {com.Summary} {GetCommandRequirements(com)} | {com.Remarks}");
helpstr.AppendLine($"`{com.Text}` {string.Join(" ", com.Aliases.Skip(1).Select(a=>"`"+a+"`"))} | {string.Format(com.Summary, com.Module.Prefix)} {GetCommandRequirements(com)} | {string.Format(com.Remarks, com.Module.Prefix)}");
}
helpstr = helpstr.Replace(NadekoBot.Client.GetCurrentUser().Username , "@BotName");
File.WriteAllText("../../docs/Commands List.md", helpstr.ToString());