mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-01-31 09:09:00 +03:00
Redesign reminder-related commands (#321)
In this PR, I redesigned the reminder-related commands and they will now have a quote block instead of a inline code block (to avoid some visual bugs). Except /listremind. It just has the inline code block removed. ![image](https://github.com/TeamOctolings/Octobot/assets/95250141/3521af97-ee11-405f-8cc2-7bf9a747e757)
This commit is contained in:
parent
930b7ca6ed
commit
07e8784d2e
3 changed files with 18 additions and 6 deletions
|
@ -94,7 +94,7 @@ public sealed class RemindCommandGroup : CommandGroup
|
||||||
{
|
{
|
||||||
var reminder = data.Reminders[i];
|
var reminder = data.Reminders[i];
|
||||||
builder.AppendBulletPointLine(string.Format(Messages.ReminderPosition, Markdown.InlineCode((i + 1).ToString())))
|
builder.AppendBulletPointLine(string.Format(Messages.ReminderPosition, Markdown.InlineCode((i + 1).ToString())))
|
||||||
.AppendSubBulletPointLine(string.Format(Messages.ReminderText, Markdown.InlineCode(reminder.Text)))
|
.AppendSubBulletPointLine(string.Format(Messages.ReminderText, reminder.Text))
|
||||||
.AppendSubBulletPointLine(string.Format(Messages.ReminderTime, Markdown.Timestamp(reminder.At)))
|
.AppendSubBulletPointLine(string.Format(Messages.ReminderTime, Markdown.Timestamp(reminder.At)))
|
||||||
.AppendSubBulletPointLine(string.Format(Messages.DescriptionActionJumpToMessage, $"https://discord.com/channels/{guildId.Value}/{reminder.ChannelId}/{reminder.MessageId}"));
|
.AppendSubBulletPointLine(string.Format(Messages.DescriptionActionJumpToMessage, $"https://discord.com/channels/{guildId.Value}/{reminder.ChannelId}/{reminder.MessageId}"));
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,7 @@ public sealed class RemindCommandGroup : CommandGroup
|
||||||
});
|
});
|
||||||
|
|
||||||
var builder = new StringBuilder()
|
var builder = new StringBuilder()
|
||||||
.AppendBulletPointLine(string.Format(Messages.ReminderText, Markdown.InlineCode(text)))
|
.AppendLine(MarkdownExtensions.Quote(text))
|
||||||
.AppendBulletPoint(string.Format(Messages.ReminderTime, Markdown.Timestamp(remindAt)));
|
.AppendBulletPoint(string.Format(Messages.ReminderTime, Markdown.Timestamp(remindAt)));
|
||||||
var embed = new EmbedBuilder().WithSmallTitle(
|
var embed = new EmbedBuilder().WithSmallTitle(
|
||||||
string.Format(Messages.ReminderCreated, executor.GetTag()), executor)
|
string.Format(Messages.ReminderCreated, executor.GetTag()), executor)
|
||||||
|
@ -279,7 +279,7 @@ public sealed class RemindCommandGroup : CommandGroup
|
||||||
data.Reminders.RemoveAt(index);
|
data.Reminders.RemoveAt(index);
|
||||||
|
|
||||||
var builder = new StringBuilder()
|
var builder = new StringBuilder()
|
||||||
.AppendBulletPointLine(string.Format(Messages.ReminderText, Markdown.InlineCode(oldReminder.Text)))
|
.AppendLine(MarkdownExtensions.Quote(oldReminder.Text))
|
||||||
.AppendBulletPoint(string.Format(Messages.ReminderTime, Markdown.Timestamp(remindAt)));
|
.AppendBulletPoint(string.Format(Messages.ReminderTime, Markdown.Timestamp(remindAt)));
|
||||||
var embed = new EmbedBuilder().WithSmallTitle(
|
var embed = new EmbedBuilder().WithSmallTitle(
|
||||||
string.Format(Messages.ReminderEdited, executor.GetTag()), executor)
|
string.Format(Messages.ReminderEdited, executor.GetTag()), executor)
|
||||||
|
@ -309,7 +309,7 @@ public sealed class RemindCommandGroup : CommandGroup
|
||||||
data.Reminders.RemoveAt(index);
|
data.Reminders.RemoveAt(index);
|
||||||
|
|
||||||
var builder = new StringBuilder()
|
var builder = new StringBuilder()
|
||||||
.AppendBulletPointLine(string.Format(Messages.ReminderText, Markdown.InlineCode(value)))
|
.AppendLine(MarkdownExtensions.Quote(value))
|
||||||
.AppendBulletPoint(string.Format(Messages.ReminderTime, Markdown.Timestamp(oldReminder.At)));
|
.AppendBulletPoint(string.Format(Messages.ReminderTime, Markdown.Timestamp(oldReminder.At)));
|
||||||
var embed = new EmbedBuilder().WithSmallTitle(
|
var embed = new EmbedBuilder().WithSmallTitle(
|
||||||
string.Format(Messages.ReminderEdited, executor.GetTag()), executor)
|
string.Format(Messages.ReminderEdited, executor.GetTag()), executor)
|
||||||
|
@ -367,7 +367,7 @@ public sealed class RemindCommandGroup : CommandGroup
|
||||||
var reminder = data.Reminders[index];
|
var reminder = data.Reminders[index];
|
||||||
|
|
||||||
var description = new StringBuilder()
|
var description = new StringBuilder()
|
||||||
.AppendBulletPointLine(string.Format(Messages.ReminderText, Markdown.InlineCode(reminder.Text)))
|
.AppendLine(MarkdownExtensions.Quote(reminder.Text))
|
||||||
.AppendBulletPointLine(string.Format(Messages.ReminderTime, Markdown.Timestamp(reminder.At)));
|
.AppendBulletPointLine(string.Format(Messages.ReminderTime, Markdown.Timestamp(reminder.At)));
|
||||||
|
|
||||||
data.Reminders.RemoveAt(index);
|
data.Reminders.RemoveAt(index);
|
||||||
|
|
|
@ -13,4 +13,16 @@ public static class MarkdownExtensions
|
||||||
{
|
{
|
||||||
return $"- {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}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,7 +234,7 @@ public sealed partial class MemberUpdateService : BackgroundService
|
||||||
}
|
}
|
||||||
|
|
||||||
var builder = new StringBuilder()
|
var builder = new StringBuilder()
|
||||||
.AppendBulletPointLine(string.Format(Messages.DescriptionReminder, Markdown.InlineCode(reminder.Text)))
|
.AppendLine(MarkdownExtensions.Quote(reminder.Text))
|
||||||
.AppendBulletPointLine(string.Format(Messages.DescriptionActionJumpToMessage,
|
.AppendBulletPointLine(string.Format(Messages.DescriptionActionJumpToMessage,
|
||||||
$"https://discord.com/channels/{guildId.Value}/{reminder.ChannelId}/{reminder.MessageId}"));
|
$"https://discord.com/channels/{guildId.Value}/{reminder.ChannelId}/{reminder.MessageId}"));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue