diff --git a/SecondBotEvents/WikiService.cs b/SecondBotEvents/WikiService.cs index 037f41f..da9d1c9 100644 --- a/SecondBotEvents/WikiService.cs +++ b/SecondBotEvents/WikiService.cs @@ -213,6 +213,7 @@ namespace SecondBotEvents Dictionary hints = []; Dictionary hinttypes = []; Dictionary hintexamplevalue = []; + Dictionary hintacceptvalues = []; string examplecall = method.Name; foreach (ArgHints At in method.GetCustomAttributes()) @@ -220,13 +221,14 @@ namespace SecondBotEvents hints.Add(At.name, At.about); hinttypes.Add(At.name, At.defaultValueType); hintexamplevalue.Add(At.name, At.exampleValue); + hintacceptvalues.Add(At.name, At.acceptedValues); } if (method.GetParameters().Length > 0) { content = content + "
Args
"; content = content + ""; - content = content + ""; + content = content + ""; bool hadStartSplit = false; string addon = ""; foreach (ParameterInfo pram in method.GetParameters()) @@ -242,6 +244,29 @@ namespace SecondBotEvents string hinttype = ""; string hintexample = ""; string hintexamplecmd = ""; + string hinttextsuggested = ""; + if(hintacceptvalues.ContainsKey(pram.Name) == true) + { + if (hintacceptvalues[pram.Name] != null) + { + hinttextsuggested = ""; + string addoncsv = ""; + int loop = 0; + foreach(string a in hintacceptvalues[pram.Name]) + { + if (loop == 3) + { + hinttextsuggested = hinttextsuggested + "
"; + addoncsv = ""; + loop = 0; + } + hinttextsuggested = hinttextsuggested + addoncsv; + hinttextsuggested = hinttextsuggested + a; + addoncsv = ", "; + loop++; + } + } + } if (hintexamplevalue.ContainsKey(pram.Name) == true) { if (hintexamplevalue[pram.Name] != null) @@ -287,6 +312,7 @@ namespace SecondBotEvents "" + "" + "" + + "" + ""; } content = content + "
NameHintTypeExample
HintTypeExample valueSupported values
" + hinttext + ""+ hinttype+""+ hintexample +"" + hinttextsuggested + "
"; @@ -301,7 +327,7 @@ namespace SecondBotEvents { content = content + "
  • ❌ "+ At.hint+"
  • "; } - content = content + "
    Example call

    "+examplecall+""; + content = content + "
    Example call

    "+examplecall+"

    "; makefile("command"+method.Name.ToLower(), content, "Command info for " + method.Name); }