1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-05-04 13:06:29 +03:00

Continue adapting code to new guild data storage

This commit is contained in:
Octol1ttle 2022-12-30 18:34:48 +05:00
parent 163e3ac46b
commit fe2cfb3b3c
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF
10 changed files with 145 additions and 94 deletions

View file

@ -0,0 +1,19 @@
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).ToUnixTimeSeconds(),
ReminderText = reminderText
});
return Task.CompletedTask;
}
}