Throw "no registered switches" error also with frontpercent
This commit is contained in:
parent
272a3430a6
commit
8cbb2424d7
@ -505,6 +505,9 @@ namespace PluralKit.Bot
|
|||||||
var targetSystem = await GetGroupSystem(ctx, target, conn);
|
var targetSystem = await GetGroupSystem(ctx, target, conn);
|
||||||
ctx.CheckSystemPrivacy(targetSystem, targetSystem.FrontHistoryPrivacy);
|
ctx.CheckSystemPrivacy(targetSystem, targetSystem.FrontHistoryPrivacy);
|
||||||
|
|
||||||
|
var totalSwitches = await _db.Execute(conn => _repo.GetSwitchCount(conn, targetSystem.Id));
|
||||||
|
if (totalSwitches == 0) throw Errors.NoRegisteredSwitches;
|
||||||
|
|
||||||
string durationStr = ctx.RemainderOrNull() ?? "30d";
|
string durationStr = ctx.RemainderOrNull() ?? "30d";
|
||||||
|
|
||||||
var now = SystemClock.Instance.GetCurrentInstant();
|
var now = SystemClock.Instance.GetCurrentInstant();
|
||||||
|
@ -117,6 +117,9 @@ namespace PluralKit.Bot
|
|||||||
if (system == null) throw Errors.NoSystemError;
|
if (system == null) throw Errors.NoSystemError;
|
||||||
ctx.CheckSystemPrivacy(system, system.FrontHistoryPrivacy);
|
ctx.CheckSystemPrivacy(system, system.FrontHistoryPrivacy);
|
||||||
|
|
||||||
|
var totalSwitches = await _db.Execute(conn => _repo.GetSwitchCount(conn, system.Id));
|
||||||
|
if (totalSwitches == 0) throw Errors.NoRegisteredSwitches;
|
||||||
|
|
||||||
string durationStr = ctx.RemainderOrNull() ?? "30d";
|
string durationStr = ctx.RemainderOrNull() ?? "30d";
|
||||||
|
|
||||||
var now = SystemClock.Instance.GetCurrentInstant();
|
var now = SystemClock.Instance.GetCurrentInstant();
|
||||||
|
Loading…
Reference in New Issue
Block a user