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:
parent
163e3ac46b
commit
fe2cfb3b3c
10 changed files with 145 additions and 94 deletions
19
Boyfriend/Commands/RemindCommand.cs
Normal file
19
Boyfriend/Commands/RemindCommand.cs
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue