Browse Source

Fix ToString() on CommandInfo (#2094)

tags/3.3.1
Armano den Boef GitHub 3 years ago
parent
commit
01735c82fb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
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);
} }
} }
} }

||||||
x
 
000:0
Loading…
Cancel
Save