Escape markup in CLI

pull/1145/head
Tyrrrz 1 year ago
parent 8d01c6be35
commit b298b45cf7

@ -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 }
);

Loading…
Cancel
Save