mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-01-31 23:29:12 +00:00
Escape markup in CLI
This commit is contained in:
@@ -200,7 +200,7 @@ public abstract class ExportCommandBase : DiscordCommandBase
|
||||
try
|
||||
{
|
||||
await ctx.StartTaskAsync(
|
||||
channel.GetHierarchicalName(),
|
||||
Markup.Escape(channel.GetHierarchicalName()),
|
||||
async progress =>
|
||||
{
|
||||
var guild = await Discord.GetGuildAsync(
|
||||
|
||||
@@ -80,7 +80,10 @@ public class ExportAllCommand : ExportCommandBase
|
||||
|
||||
channels.Add(channel);
|
||||
|
||||
ctx.Status($"Fetched '{channel.GetHierarchicalName()}'.");
|
||||
ctx.Status(
|
||||
Markup.Escape($"Fetched '{channel.GetHierarchicalName()}'.")
|
||||
);
|
||||
|
||||
fetchedChannelsCount++;
|
||||
}
|
||||
}
|
||||
@@ -114,7 +117,10 @@ public class ExportAllCommand : ExportCommandBase
|
||||
{
|
||||
channels.Add(thread);
|
||||
|
||||
ctx.Status($"Fetched '{thread.GetHierarchicalName()}'.");
|
||||
ctx.Status(
|
||||
Markup.Escape($"Fetched '{thread.GetHierarchicalName()}'.")
|
||||
);
|
||||
|
||||
fetchedThreadsCount++;
|
||||
}
|
||||
}
|
||||
@@ -142,7 +148,11 @@ public class ExportAllCommand : ExportCommandBase
|
||||
{
|
||||
foreach (var dumpChannel in dump.Channels)
|
||||
{
|
||||
ctx.Status($"Fetching '{dumpChannel.Name}' ({dumpChannel.Id})...");
|
||||
ctx.Status(
|
||||
Markup.Escape(
|
||||
$"Fetching '{dumpChannel.Name}' ({dumpChannel.Id})..."
|
||||
)
|
||||
);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -58,7 +58,8 @@ public class ExportGuildCommand : ExportCommandBase
|
||||
|
||||
channels.Add(channel);
|
||||
|
||||
ctx.Status($"Fetched '{channel.GetHierarchicalName()}'.");
|
||||
ctx.Status(Markup.Escape($"Fetched '{channel.GetHierarchicalName()}'."));
|
||||
|
||||
fetchedChannelsCount++;
|
||||
}
|
||||
}
|
||||
@@ -90,7 +91,8 @@ public class ExportGuildCommand : ExportCommandBase
|
||||
{
|
||||
channels.Add(thread);
|
||||
|
||||
ctx.Status($"Fetched '{thread.GetHierarchicalName()}'.");
|
||||
ctx.Status(Markup.Escape($"Fetched '{thread.GetHierarchicalName()}'."));
|
||||
|
||||
fetchedThreadsCount++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,8 +44,7 @@ internal static class ConsoleExtensions
|
||||
var actualDescription = !string.IsNullOrWhiteSpace(description) ? description : "...";
|
||||
|
||||
var progressTask = context.AddTask(
|
||||
// Don't recognize random square brackets as style tags
|
||||
Markup.Escape(actualDescription),
|
||||
actualDescription,
|
||||
new ProgressTaskSettings { MaxValue = 1 }
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user