mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-11 00:07:55 +00:00
refactor: add SqlKata for SQL generation, move connection handling into ModelRepository
This commit is contained in:
parent
6251d29abb
commit
92e45a07ff
60 changed files with 806 additions and 640 deletions
|
|
@ -1,3 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
|
@ -26,13 +27,10 @@ namespace PluralKit.Bot
|
|||
{
|
||||
ctx.CheckSystem();
|
||||
|
||||
var members = await _db.Execute(c =>
|
||||
{
|
||||
if (ctx.MatchFlag("all", "a"))
|
||||
return _repo.GetSystemMembers(c, ctx.System.Id);
|
||||
return _repo.GetSystemMembers(c, ctx.System.Id)
|
||||
.Where(m => m.MemberVisibility == PrivacyLevel.Public);
|
||||
}).ToListAsync();
|
||||
var members = await _repo.GetSystemMembers(ctx.System.Id).ToListAsync();
|
||||
|
||||
if (!ctx.MatchFlag("all", "a"))
|
||||
members = members.Where(m => m.MemberVisibility == PrivacyLevel.Public).ToList();
|
||||
|
||||
if (members == null || !members.Any())
|
||||
throw new PKError("Your system has no members! Please create at least one member before using this command.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue