mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix(bot): correctly check for existence of current system in embeds
This commit is contained in:
parent
9c99a0bc02
commit
24361d9d2b
1 changed files with 6 additions and 6 deletions
|
|
@ -57,7 +57,7 @@ public class EmbedService
|
||||||
var countctx = LookupContext.ByNonOwner;
|
var countctx = LookupContext.ByNonOwner;
|
||||||
if (cctx.MatchFlag("a", "all"))
|
if (cctx.MatchFlag("a", "all"))
|
||||||
{
|
{
|
||||||
if (system.Id == cctx.System.Id)
|
if (system.Id == cctx.System?.Id)
|
||||||
countctx = LookupContext.ByOwner;
|
countctx = LookupContext.ByOwner;
|
||||||
else
|
else
|
||||||
throw Errors.LookupNotAllowed;
|
throw Errors.LookupNotAllowed;
|
||||||
|
|
@ -89,7 +89,7 @@ public class EmbedService
|
||||||
if (system.MemberListPrivacy.CanAccess(ctx))
|
if (system.MemberListPrivacy.CanAccess(ctx))
|
||||||
{
|
{
|
||||||
headerText += $"\n**Members:** {memberCount}";
|
headerText += $"\n**Members:** {memberCount}";
|
||||||
if (system.Id == cctx.System.Id)
|
if (system.Id == cctx.System?.Id)
|
||||||
if (memberCount > 0)
|
if (memberCount > 0)
|
||||||
headerText += $" (see `{cctx.DefaultPrefix}system list`)";
|
headerText += $" (see `{cctx.DefaultPrefix}system list`)";
|
||||||
else
|
else
|
||||||
|
|
@ -215,7 +215,7 @@ public class EmbedService
|
||||||
var countctx = LookupContext.ByNonOwner;
|
var countctx = LookupContext.ByNonOwner;
|
||||||
if (cctx.MatchFlag("a", "all"))
|
if (cctx.MatchFlag("a", "all"))
|
||||||
{
|
{
|
||||||
if (system.Id == cctx.System.Id)
|
if (system.Id == cctx.System?.Id)
|
||||||
countctx = LookupContext.ByOwner;
|
countctx = LookupContext.ByOwner;
|
||||||
else
|
else
|
||||||
throw Errors.LookupNotAllowed;
|
throw Errors.LookupNotAllowed;
|
||||||
|
|
@ -570,7 +570,7 @@ public class EmbedService
|
||||||
var countctx = LookupContext.ByNonOwner;
|
var countctx = LookupContext.ByNonOwner;
|
||||||
if (ctx.MatchFlag("a", "all"))
|
if (ctx.MatchFlag("a", "all"))
|
||||||
{
|
{
|
||||||
if (system.Id == ctx.System.Id)
|
if (system.Id == ctx.System?.Id)
|
||||||
countctx = LookupContext.ByOwner;
|
countctx = LookupContext.ByOwner;
|
||||||
else
|
else
|
||||||
throw Errors.LookupNotAllowed;
|
throw Errors.LookupNotAllowed;
|
||||||
|
|
@ -588,7 +588,7 @@ public class EmbedService
|
||||||
if (target.ListPrivacy.CanAccess(pctx))
|
if (target.ListPrivacy.CanAccess(pctx))
|
||||||
{
|
{
|
||||||
headerText += $"\n**Members:** {memberCount}";
|
headerText += $"\n**Members:** {memberCount}";
|
||||||
if (system.Id == ctx.System.Id && memberCount == 0)
|
if (system.Id == ctx.System?.Id && memberCount == 0)
|
||||||
headerText += $" (add one with `{ctx.DefaultPrefix}group {target.Reference(ctx)} add <member>`!)";
|
headerText += $" (add one with `{ctx.DefaultPrefix}group {target.Reference(ctx)} add <member>`!)";
|
||||||
else if (memberCount > 0)
|
else if (memberCount > 0)
|
||||||
headerText += $" (see `{ctx.DefaultPrefix}group {target.Reference(ctx)} list`)";
|
headerText += $" (see `{ctx.DefaultPrefix}group {target.Reference(ctx)} list`)";
|
||||||
|
|
@ -680,7 +680,7 @@ public class EmbedService
|
||||||
var countctx = LookupContext.ByNonOwner;
|
var countctx = LookupContext.ByNonOwner;
|
||||||
if (ctx.MatchFlag("a", "all"))
|
if (ctx.MatchFlag("a", "all"))
|
||||||
{
|
{
|
||||||
if (system.Id == ctx.System.Id)
|
if (system.Id == ctx.System?.Id)
|
||||||
countctx = LookupContext.ByOwner;
|
countctx = LookupContext.ByOwner;
|
||||||
else
|
else
|
||||||
throw Errors.LookupNotAllowed;
|
throw Errors.LookupNotAllowed;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue