1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-30 11:09:54 +03:00

Add StringBuilder & Markdown extensions (#206)

In this PR, I have added StringBuilder extensions to avoid `.Append`
reuse such as `.Append("- ").AppendLine()`

Closes #205

---------

Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
Macintxsh 2023-12-04 17:09:47 +03:00 committed by GitHub
parent 5fce01c15c
commit 18cdc63883
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 119 additions and 44 deletions

View file

@ -134,7 +134,7 @@ public class KickCommandGroup : CommandGroup
{
var dmEmbed = new EmbedBuilder().WithGuildTitle(guild)
.WithTitle(Messages.YouWereKicked)
.WithDescription($"- {string.Format(Messages.DescriptionActionReason, reason)}")
.WithDescription(MarkdownExtensions.BulletPoint(string.Format(Messages.DescriptionActionReason, reason)))
.WithActionFooter(executor)
.WithCurrentTimestamp()
.WithColour(ColorsList.Red)
@ -159,7 +159,7 @@ public class KickCommandGroup : CommandGroup
data.GetOrCreateMemberData(target.ID).Roles.Clear();
var title = string.Format(Messages.UserKicked, target.GetTag());
var description = $"- {string.Format(Messages.DescriptionActionReason, reason)}";
var description = MarkdownExtensions.BulletPoint(string.Format(Messages.DescriptionActionReason, reason));
var logResult = _utility.LogActionAsync(
data.Settings, channelId, executor, title, description, target, ColorsList.Red, ct: ct);
if (!logResult.IsSuccess)