From 01735c82fb933efe90c8681e4780c0d9f28eddd4 Mon Sep 17 00:00:00 2001
From: Armano den Boef <68127614+Rozen4334@users.noreply.github.com>
Date: Sat, 12 Feb 2022 02:45:36 +0100
Subject: [PATCH] Fix ToString() on CommandInfo (#2094)
---
docs/guides/int_basics/intro.md | 10 ----------
.../Info/Commands/CommandInfo.cs | 9 +++++----
2 files changed, 5 insertions(+), 14 deletions(-)
delete mode 100644 docs/guides/int_basics/intro.md
diff --git a/docs/guides/int_basics/intro.md b/docs/guides/int_basics/intro.md
deleted file mode 100644
index 62b2dfdb5..000000000
--- a/docs/guides/int_basics/intro.md
+++ /dev/null
@@ -1,10 +0,0 @@
----
-uid: Guides.Interactions.Intro
-title: Introduction to Interactions
----
-
-# Interactions
-
-Placeholder text does the brrr.
-
-Links to different sections of guides: msg comp / slash commands.
diff --git a/src/Discord.Net.Interactions/Info/Commands/CommandInfo.cs b/src/Discord.Net.Interactions/Info/Commands/CommandInfo.cs
index cfbcbacf2..cf1a2dfa1 100644
--- a/src/Discord.Net.Interactions/Info/Commands/CommandInfo.cs
+++ b/src/Discord.Net.Interactions/Info/Commands/CommandInfo.cs
@@ -253,20 +253,21 @@ namespace Discord.Interactions
///
public override string ToString()
{
- StringBuilder builder = new();
+ List builder = new();
var currentParent = Module;
while (currentParent != null)
{
if (currentParent.IsSlashGroup)
- builder.AppendFormat(" {0}", currentParent.SlashGroupName);
+ builder.Add(currentParent.SlashGroupName);
currentParent = currentParent.Parent;
}
- builder.AppendFormat(" {0}", Name);
+ builder.Reverse();
+ builder.Add(Name);
- return builder.ToString().Trim();
+ return string.Join(" ", builder);
}
}
}