Skip to content

Commit

Permalink
fuck workarounds, i have a fresh idea
Browse files Browse the repository at this point in the history
  • Loading branch information
mctaylors committed Jul 1, 2024
1 parent 1dffff2 commit 2b9e3c8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
8 changes: 4 additions & 4 deletions TeamOctolings.Octobot/Commands/RemindCommandGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ private async Task<Result> AddReminderAsync(TimeSpan timeSpan, string text, Guil
});

var builder = new StringBuilder()
.AppendBulletPointLine(string.Format(Messages.ReminderText, text))
.AppendLine(MarkdownExtensions.Quote(text))
.AppendBulletPoint(string.Format(Messages.ReminderTime, Markdown.Timestamp(remindAt)));
var embed = new EmbedBuilder().WithSmallTitle(
string.Format(Messages.ReminderCreated, executor.GetTag()), executor)
Expand Down Expand Up @@ -279,7 +279,7 @@ private async Task<Result> EditReminderTimeAsync(int index, string value, Member
data.Reminders.RemoveAt(index);

var builder = new StringBuilder()
.AppendBulletPointLine(string.Format(Messages.ReminderText, oldReminder.Text))
.AppendLine(MarkdownExtensions.Quote(oldReminder.Text))
.AppendBulletPoint(string.Format(Messages.ReminderTime, Markdown.Timestamp(remindAt)));
var embed = new EmbedBuilder().WithSmallTitle(
string.Format(Messages.ReminderEdited, executor.GetTag()), executor)
Expand Down Expand Up @@ -309,7 +309,7 @@ private async Task<Result> EditReminderTextAsync(int index, string value, Member
data.Reminders.RemoveAt(index);

var builder = new StringBuilder()
.AppendBulletPointLine(string.Format(Messages.ReminderText, value))
.AppendLine(MarkdownExtensions.Quote(value))
.AppendBulletPoint(string.Format(Messages.ReminderTime, Markdown.Timestamp(oldReminder.At)));
var embed = new EmbedBuilder().WithSmallTitle(
string.Format(Messages.ReminderEdited, executor.GetTag()), executor)
Expand Down Expand Up @@ -367,7 +367,7 @@ private Task<Result> DeleteReminderAsync(MemberData data, int index, IUser bot,
var reminder = data.Reminders[index];

var description = new StringBuilder()
.AppendBulletPointLine(string.Format(Messages.ReminderText, reminder.Text))
.AppendLine(MarkdownExtensions.Quote(reminder.Text))
.AppendBulletPointLine(string.Format(Messages.ReminderTime, Markdown.Timestamp(reminder.At)));

data.Reminders.RemoveAt(index);
Expand Down
12 changes: 12 additions & 0 deletions TeamOctolings.Octobot/Extensions/MarkdownExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,16 @@ public static string BulletPoint(string text)
{
return $"- {text}";
}

/// <summary>
/// Formats a string to use Markdown Quote formatting.
/// </summary>
/// <param name="text">The input text to format.</param>
/// <returns>
/// A markdown-formatted quote string.
/// </returns>
public static string Quote(string text)
{
return $"> {text}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ private async Task<Result> TickReminderAsync(Reminder reminder, IUser user, Memb
}

var builder = new StringBuilder()
.AppendBulletPointLine(string.Format(Messages.DescriptionReminder, Markdown.InlineCode(reminder.Text)))
.AppendLine(MarkdownExtensions.Quote(reminder.Text))
.AppendBulletPointLine(string.Format(Messages.DescriptionActionJumpToMessage,
$"https://discord.com/channels/{guildId.Value}/{reminder.ChannelId}/{reminder.MessageId}"));

Expand Down

0 comments on commit 2b9e3c8

Please sign in to comment.