mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-07 22:37:54 +00:00
feat: cfg option to log a switch when proxying
This commit is contained in:
parent
0c802ab0bd
commit
dfcef884f2
9 changed files with 49 additions and 3 deletions
|
|
@ -123,6 +123,13 @@ public class Config
|
|||
"off"
|
||||
));
|
||||
|
||||
items.Add(new(
|
||||
"Proxy Switch",
|
||||
"Whether using a proxy tag logs a switch",
|
||||
EnabledDisabled(ctx.Config.ProxySwitch),
|
||||
"disabled"
|
||||
));
|
||||
|
||||
await ctx.Paginate<PaginatedConfigItem>(
|
||||
items.ToAsyncEnumerable(),
|
||||
items.Count,
|
||||
|
|
@ -537,6 +544,20 @@ public class Config
|
|||
else throw new PKError(badInputError);
|
||||
}
|
||||
|
||||
public async Task ProxySwitch(Context ctx)
|
||||
{
|
||||
if (!ctx.HasNext())
|
||||
{
|
||||
var msg = $"Logging a switch every time a proxy tag is used is currently **{EnabledDisabled(ctx.Config.ProxySwitch)}**.";
|
||||
await ctx.Reply(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
var newVal = ctx.MatchToggle(false);
|
||||
await ctx.Repository.UpdateSystemConfig(ctx.System.Id, new() { ProxySwitch = newVal });
|
||||
await ctx.Reply($"Logging a switch every time a proxy tag is used is now {EnabledDisabled(newVal)}.");
|
||||
}
|
||||
|
||||
public Task LimitUpdate(Context ctx)
|
||||
{
|
||||
throw new PKError("You cannot update your own member or group limits. If you need a limit update, please join the " +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue