mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
feat(bot): add option to log a switch when proxying
This commit is contained in:
parent
a0f6ed6f89
commit
e1c2e6b6d6
10 changed files with 50 additions and 3 deletions
|
|
@ -506,6 +506,10 @@ public class ProxyService
|
|||
|
||||
Task DispatchWebhook() => _dispatch.Dispatch(ctx.SystemId.Value, sentMessage);
|
||||
|
||||
Task MaybeLogSwitch() => (ctx.ProxySwitch && !Array.Exists(ctx.LastSwitchMembers, element => element == match.Member.Id))
|
||||
? _db.Execute(conn => _repo.AddSwitch(conn, (SystemId)ctx.SystemId, new[] { match.Member.Id }))
|
||||
: Task.CompletedTask;
|
||||
|
||||
async Task DeleteProxyTriggerMessage()
|
||||
{
|
||||
if (!deletePrevious)
|
||||
|
|
@ -539,7 +543,8 @@ public class ProxyService
|
|||
UpdateMemberForSentMessage(),
|
||||
LogMessageToChannel(),
|
||||
SaveLatchAutoproxy(),
|
||||
DispatchWebhook()
|
||||
DispatchWebhook(),
|
||||
MaybeLogSwitch()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue