.timely will now have a button to set a reminder

This commit is contained in:
Kwoth
2022-07-02 14:15:02 +02:00
parent 2e4de7723e
commit 5c933b676d
4 changed files with 71 additions and 6 deletions

View File

@@ -178,4 +178,26 @@ public class RemindService : INService, IReadyExecutor
public string What { get; set; }
public TimeSpan Time { get; set; }
}
public async Task AddReminderAsync(ulong userId,
ulong channelId,
ulong? guildId,
bool isPrivate,
DateTime time,
string message)
{
var rem = new Reminder
{
UserId = userId,
ChannelId = channelId,
ServerId = guildId ?? 0,
IsPrivate = isPrivate,
When = time,
Message = message,
};
await using var ctx = _db.GetDbContext();
await ctx.Reminders
.AddAsync(rem);
}
}