Browse Source

Patches tostring

pull/2094/head
Armano den Boef 3 years ago
parent
commit
38519c9947
2 changed files with 5 additions and 14 deletions
  1. +0
    -10
      docs/guides/int_basics/intro.md
  2. +5
    -4
      src/Discord.Net.Interactions/Info/Commands/CommandInfo.cs

+ 0
- 10
docs/guides/int_basics/intro.md View File

@@ -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.

+ 5
- 4
src/Discord.Net.Interactions/Info/Commands/CommandInfo.cs View File

@@ -253,20 +253,21 @@ namespace Discord.Interactions
/// <inheritdoc/> /// <inheritdoc/>
public override string ToString() public override string ToString()
{ {
StringBuilder builder = new();
List<string> builder = new();


var currentParent = Module; var currentParent = Module;


while (currentParent != null) while (currentParent != null)
{ {
if (currentParent.IsSlashGroup) if (currentParent.IsSlashGroup)
builder.AppendFormat(" {0}", currentParent.SlashGroupName);
builder.Add(currentParent.SlashGroupName);


currentParent = currentParent.Parent; currentParent = currentParent.Parent;
} }
builder.AppendFormat(" {0}", Name);
builder.Reverse();
builder.Add(Name);


return builder.ToString().Trim();
return string.Join(" ", builder);
} }
} }
} }

Loading…
Cancel
Save