mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
refactor(commands): remove Reset as a parameter type
This commit is contained in:
parent
6c54551a9e
commit
2a063442ea
6 changed files with 6 additions and 17 deletions
|
|
@ -51,14 +51,4 @@ public static class ContextParametersExt
|
|||
param => (param as Parameter.Toggle)?.value
|
||||
);
|
||||
}
|
||||
|
||||
// this can never really be false (either it's present and is true or it's not present)
|
||||
// but we keep it nullable for consistency with the other methods
|
||||
public static async Task<bool?> ParamResolveReset(this Context ctx, string param_name)
|
||||
{
|
||||
return await ctx.Parameters.ResolveParameter<bool?>(
|
||||
ctx, param_name,
|
||||
param => param is Parameter.Reset
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -13,7 +13,6 @@ public abstract record Parameter()
|
|||
public record PrivacyLevel(string level): Parameter;
|
||||
public record Toggle(bool value): Parameter;
|
||||
public record Opaque(string value): Parameter;
|
||||
public record Reset(): Parameter;
|
||||
}
|
||||
|
||||
public class Parameters
|
||||
|
|
@ -80,8 +79,6 @@ public class Parameters
|
|||
return new Parameter.Toggle(toggle.toggle);
|
||||
case uniffi.commands.Parameter.OpaqueString opaque:
|
||||
return new Parameter.Opaque(opaque.raw);
|
||||
case uniffi.commands.Parameter.Reset _:
|
||||
return new Parameter.Reset();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue