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,19 +9,20 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,19 @@
|
||||||
namespace Boyfriend;
|
namespace Boyfriend;
|
||||||
|
|
||||||
public static class ReplyEmojis {
|
public static class ReplyEmojis {
|
||||||
public const string Success = ":white_check_mark:";
|
public const string Success = ":white_check_mark:";
|
||||||
public const string Error = ":x:";
|
public const string Error = ":x:";
|
||||||
public const string MissingArgument = ":keyboard:";
|
public const string MissingArgument = ":keyboard:";
|
||||||
public const string InvalidArgument = ":construction:";
|
public const string InvalidArgument = ":construction:";
|
||||||
public const string NoPermission = ":no_entry_sign:";
|
public const string NoPermission = ":no_entry_sign:";
|
||||||
public const string CantInteract = ":vertical_traffic_light:";
|
public const string CantInteract = ":vertical_traffic_light:";
|
||||||
public const string Help = ":page_facing_up:";
|
public const string Help = ":page_facing_up:";
|
||||||
public const string SettingsList = ":gear:";
|
public const string SettingsList = ":gear:";
|
||||||
public const string SettingsSet = ":control_knobs:";
|
public const string SettingsSet = ":control_knobs:";
|
||||||
public const string Ping = ":signal_strength:";
|
public const string Ping = ":signal_strength:";
|
||||||
public const string Banned = ":hammer:";
|
public const string Banned = ":hammer:";
|
||||||
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