feat: cache Discord DM channels in database

This commit is contained in:
spiral
2022-01-22 02:47:47 -05:00
parent ddbf0e8691
commit 89c44a3482
14 changed files with 127 additions and 48 deletions

View File

@@ -1,9 +1,14 @@
using Dapper;
using SqlKata;
namespace PluralKit.Core;
public partial class ModelRepository
{
public async Task<ulong?> GetDmChannel(ulong id)
=> await _db.Execute(c => c.QueryFirstOrDefaultAsync<ulong?>("select dm_channel from accounts where uid = @id", new { id = id }));
public async Task UpdateAccount(ulong id, AccountPatch patch)
{
_logger.Information("Updated account {accountId}: {@AccountPatch}", id, patch);