1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-20 08:53:36 +03:00
Octobot/Boyfriend/Commands/RemindCommand.cs
Octol1ttle 4b2d98c440
Keep adapting code to new guild data storage...
Fix #15, update InspectCode, make Dependabot use the correct label
2023-01-12 22:00:52 +05:00

19 lines
785 B
C#

using Boyfriend.Data;
namespace Boyfriend.Commands;
public sealed class RemindCommand : ICommand {
public string[] Aliases { get; } = { "remind", "reminder", "remindme", "напомни", "напомнить", "напоминание" };
public Task RunAsync(CommandProcessor cmd, string[] args, string[] cleanArgs) {
var remindIn = CommandProcessor.GetTimeSpan(args, 0);
var reminderText = cmd.GetRemaining(args, 1, "ReminderText");
if (reminderText is not null)
GuildData.FromSocketGuild(cmd.Context.Guild).MemberData[cmd.Context.User.Id].Reminders.Add(new Reminder {
RemindAt = DateTimeOffset.Now.Add(remindIn),
ReminderText = reminderText
});
return Task.CompletedTask;
}
}