1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 09:09:00 +03:00

Add more info output to /delremind (#173)

_There are times when you want to be sure of what you've destroyed._

Therefore, in this PR I added the output of the text of the deleted
reminder along with its position in the list, because you can make a
mistake with deleting a reminder and forget about what you needed to be
reminded about.

---------

Signed-off-by: mctaylors <mctaylxrs@outlook.com>
This commit is contained in:
Macintxsh 2023-10-26 17:41:47 +03:00 committed by GitHub
parent 02707312f5
commit 5b84c8d8d0
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 10 deletions

View file

@ -477,8 +477,8 @@
<data name="ReminderPosition" xml:space="preserve"> <data name="ReminderPosition" xml:space="preserve">
<value>Position in list: {0}</value> <value>Position in list: {0}</value>
</data> </data>
<data name="ReminderWillBeSentOn" xml:space="preserve"> <data name="ReminderTime" xml:space="preserve">
<value>The reminder will be sent on: {0}</value> <value>Reminder send time: {0}</value>
</data> </data>
<data name="ReminderText" xml:space="preserve"> <data name="ReminderText" xml:space="preserve">
<value>Reminder text: {0}</value> <value>Reminder text: {0}</value>

View file

@ -477,8 +477,8 @@
<data name="ReminderPosition" xml:space="preserve"> <data name="ReminderPosition" xml:space="preserve">
<value>Позиция в списке: {0}</value> <value>Позиция в списке: {0}</value>
</data> </data>
<data name="ReminderWillBeSentOn" xml:space="preserve"> <data name="ReminderTime" xml:space="preserve">
<value>Напоминание будет отправлено: {0}</value> <value>Время отправки напоминания: {0}</value>
</data> </data>
<data name="ReminderText" xml:space="preserve"> <data name="ReminderText" xml:space="preserve">
<value>Текст напоминания: {0}</value> <value>Текст напоминания: {0}</value>

View file

@ -477,8 +477,8 @@
<data name="ReminderPosition" xml:space="preserve"> <data name="ReminderPosition" xml:space="preserve">
<value>номер в списке: {0}</value> <value>номер в списке: {0}</value>
</data> </data>
<data name="ReminderWillBeSentOn" xml:space="preserve"> <data name="ReminderTime" xml:space="preserve">
<value>я пну тебе это: {0}</value> <value>время отправки: {0}</value>
</data> </data>
<data name="ReminderText" xml:space="preserve"> <data name="ReminderText" xml:space="preserve">
<value>че там в напоминалке: {0}</value> <value>че там в напоминалке: {0}</value>

View file

@ -92,7 +92,7 @@ public class RemindCommandGroup : CommandGroup
builder.Append("- ").AppendLine(string.Format(Messages.ReminderPosition, Markdown.InlineCode((i + 1).ToString()))) builder.Append("- ").AppendLine(string.Format(Messages.ReminderPosition, Markdown.InlineCode((i + 1).ToString())))
.Append(" - ").AppendLine(string.Format(Messages.ReminderText, Markdown.InlineCode(reminder.Text))) .Append(" - ").AppendLine(string.Format(Messages.ReminderText, Markdown.InlineCode(reminder.Text)))
.Append(" - ") .Append(" - ")
.AppendLine(string.Format(Messages.ReminderWillBeSentOn, Markdown.Timestamp(reminder.At))); .AppendLine(string.Format(Messages.ReminderTime, Markdown.Timestamp(reminder.At)));
} }
var embed = new EmbedBuilder().WithSmallTitle( var embed = new EmbedBuilder().WithSmallTitle(
@ -155,7 +155,7 @@ public class RemindCommandGroup : CommandGroup
var builder = new StringBuilder().Append("- ").AppendLine(string.Format( var builder = new StringBuilder().Append("- ").AppendLine(string.Format(
Messages.ReminderText, Markdown.InlineCode(text))) Messages.ReminderText, Markdown.InlineCode(text)))
.Append("- ").Append(string.Format(Messages.ReminderWillBeSentOn, Markdown.Timestamp(remindAt))); .Append("- ").Append(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)
@ -210,9 +210,16 @@ public class RemindCommandGroup : CommandGroup
return await _feedback.SendContextualEmbedResultAsync(failedEmbed, ct); return await _feedback.SendContextualEmbedResultAsync(failedEmbed, ct);
} }
var reminder = data.Reminders[index];
var description = new StringBuilder()
.Append("- ").AppendLine(string.Format(Messages.ReminderText, Markdown.InlineCode(reminder.Text)))
.Append("- ").AppendLine(string.Format(Messages.ReminderTime, Markdown.Timestamp(reminder.At)));
data.Reminders.RemoveAt(index); data.Reminders.RemoveAt(index);
var embed = new EmbedBuilder().WithSmallTitle(Messages.ReminderDeleted, bot) var embed = new EmbedBuilder().WithSmallTitle(Messages.ReminderDeleted, bot)
.WithDescription(description.ToString())
.WithColour(ColorsList.Green) .WithColour(ColorsList.Green)
.Build(); .Build();

View file

@ -786,9 +786,9 @@ namespace Octobot {
} }
} }
internal static string ReminderWillBeSentOn { internal static string ReminderTime {
get { get {
return ResourceManager.GetString("ReminderWillBeSentOn", resourceCulture); return ResourceManager.GetString("ReminderTime", resourceCulture);
} }
} }