Skip to content

Commit 01735c8

Browse files
authored
Fix ToString() on CommandInfo (#2094)
1 parent 7e1b8c9 commit 01735c8

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

docs/guides/int_basics/intro.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/Discord.Net.Interactions/Info/Commands/CommandInfo.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,20 +253,21 @@ private static bool CheckTopLevel(ModuleInfo parent)
253253
/// <inheritdoc/>
254254
public override string ToString()
255255
{
256-
StringBuilder builder = new();
256+
List<string> builder = new();
257257

258258
var currentParent = Module;
259259

260260
while (currentParent != null)
261261
{
262262
if (currentParent.IsSlashGroup)
263-
builder.AppendFormat(" {0}", currentParent.SlashGroupName);
263+
builder.Add(currentParent.SlashGroupName);
264264

265265
currentParent = currentParent.Parent;
266266
}
267-
builder.AppendFormat(" {0}", Name);
267+
builder.Reverse();
268+
builder.Add(Name);
268269

269-
return builder.ToString().Trim();
270+
return string.Join(" ", builder);
270271
}
271272
}
272273
}

0 commit comments

Comments
 (0)