mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat(api): add autoproxy endpoints
This commit is contained in:
parent
67ce371e7e
commit
c87979ef03
6 changed files with 152 additions and 6 deletions
|
|
@ -6,7 +6,7 @@ namespace PluralKit.Core;
|
|||
|
||||
public partial class ModelRepository
|
||||
{
|
||||
public async Task UpdateAutoproxy(SystemId system, ulong? guildId, ulong? channelId, AutoproxyPatch patch)
|
||||
public Task<AutoproxySettings> UpdateAutoproxy(SystemId system, ulong? guildId, ulong? channelId, AutoproxyPatch patch)
|
||||
{
|
||||
var locationStr = guildId != null ? "guild" : (channelId != null ? "channel" : "global");
|
||||
_logger.Information("Updated autoproxy for {SystemId} in location {location}: {@AutoproxyPatch}", system, locationStr, patch);
|
||||
|
|
@ -17,7 +17,7 @@ public partial class ModelRepository
|
|||
.Where("channel_id", channelId ?? 0)
|
||||
);
|
||||
_ = _dispatch.Dispatch(system, guildId, channelId, patch);
|
||||
await _db.ExecuteQuery(query);
|
||||
return _db.QueryFirst<AutoproxySettings>(query, "returning *");
|
||||
}
|
||||
|
||||
// todo: this might break with differently scoped autoproxy
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue