mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-20 00:43:36 +03:00
Update RemindCommand.cs, ReplyEmojis.cs
This commit is contained in:
parent
f31cc8da5c
commit
dfc19ad641
2 changed files with 20 additions and 18 deletions
|
@ -9,20 +9,21 @@ public sealed class RemindCommand : ICommand {
|
||||||
// TODO: actually make this good
|
// TODO: actually make this good
|
||||||
var remindIn = CommandProcessor.GetTimeSpan(args, 0);
|
var remindIn = CommandProcessor.GetTimeSpan(args, 0);
|
||||||
var reminderText = cmd.GetRemaining(cleanArgs, 1, "ReminderText");
|
var reminderText = cmd.GetRemaining(cleanArgs, 1, "ReminderText");
|
||||||
|
var reminderOffset = DateTimeOffset.Now.Add(remindIn);
|
||||||
if (reminderText is not null) {
|
if (reminderText is not null) {
|
||||||
GuildData.Get(cmd.Context.Guild).MemberData[cmd.Context.User.Id].Reminders.Add(
|
GuildData.Get(cmd.Context.Guild).MemberData[cmd.Context.User.Id].Reminders.Add(
|
||||||
new Reminder {
|
new Reminder {
|
||||||
RemindAt = DateTimeOffset.Now.Add(remindIn),
|
RemindAt = reminderOffset,
|
||||||
ReminderText = reminderText,
|
ReminderText = reminderText,
|
||||||
ReminderChannel = cmd.Context.Channel.Id
|
ReminderChannel = cmd.Context.Channel.Id
|
||||||
});
|
});
|
||||||
var feedback = string.Format(Messages.FeedbackReminderAdded, DateTimeOffset.Now.Add(remindIn).ToUnixTimeSeconds());
|
|
||||||
cmd.Reply(feedback, ReplyEmojis.Success);
|
|
||||||
cmd.Audit(feedback);
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.ConfigWriteScheduled = true;
|
cmd.ConfigWriteScheduled = true;
|
||||||
|
|
||||||
|
var feedback = string.Format(Messages.FeedbackReminderAdded, reminderOffset.ToUnixTimeSeconds().ToString());
|
||||||
|
cmd.Reply(feedback, ReplyEmojis.Reminder);
|
||||||
|
}
|
||||||
|
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,4 +15,5 @@ public static class ReplyEmojis {
|
||||||
public const string Kicked = ":police_car:";
|
public const string Kicked = ":police_car:";
|
||||||
public const string Muted = ":mute:";
|
public const string Muted = ":mute:";
|
||||||
public const string Unmuted = ":loud_sound:";
|
public const string Unmuted = ":loud_sound:";
|
||||||
|
public const string Reminder = ":alarm_clock:";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue