mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-03 20:49:54 +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:
parent
02707312f5
commit
5b84c8d8d0
5 changed files with 17 additions and 10 deletions
|
@ -92,7 +92,7 @@ public class RemindCommandGroup : CommandGroup
|
|||
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.ReminderWillBeSentOn, Markdown.Timestamp(reminder.At)));
|
||||
.AppendLine(string.Format(Messages.ReminderTime, Markdown.Timestamp(reminder.At)));
|
||||
}
|
||||
|
||||
var embed = new EmbedBuilder().WithSmallTitle(
|
||||
|
@ -155,7 +155,7 @@ public class RemindCommandGroup : CommandGroup
|
|||
|
||||
var builder = new StringBuilder().Append("- ").AppendLine(string.Format(
|
||||
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(
|
||||
string.Format(Messages.ReminderCreated, executor.GetTag()), executor)
|
||||
|
@ -210,9 +210,16 @@ public class RemindCommandGroup : CommandGroup
|
|||
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);
|
||||
|
||||
var embed = new EmbedBuilder().WithSmallTitle(Messages.ReminderDeleted, bot)
|
||||
.WithDescription(description.ToString())
|
||||
.WithColour(ColorsList.Green)
|
||||
.Build();
|
||||
|
||||
|
|
4
src/Messages.Designer.cs
generated
4
src/Messages.Designer.cs
generated
|
@ -786,9 +786,9 @@ namespace Octobot {
|
|||
}
|
||||
}
|
||||
|
||||
internal static string ReminderWillBeSentOn {
|
||||
internal static string ReminderTime {
|
||||
get {
|
||||
return ResourceManager.GetString("ReminderWillBeSentOn", resourceCulture);
|
||||
return ResourceManager.GetString("ReminderTime", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue