summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/Member.ts2
-rw-r--r--src/util/User.ts14
2 files changed, 10 insertions, 6 deletions
diff --git a/src/util/Member.ts b/src/util/Member.ts

index f3097828..2df34073 100644 --- a/src/util/Member.ts +++ b/src/util/Member.ts
@@ -34,7 +34,7 @@ export async function addMember(user_id: bigint, guild_id: bigint, cache?: { gui const { maxGuilds } = Config.get().limits.user; if (guildSize >= maxGuilds) { - throw new HTTPError(` You are at the ${maxGuilds} server limit.`, 403); + throw new HTTPError(`You are at the ${maxGuilds} server limit.`, 403); } const guild = cache?.guild || (await GuildModel.findOne({ id: guild_id }).exec()); diff --git a/src/util/User.ts b/src/util/User.ts
index 778730e2..1b13e153 100644 --- a/src/util/User.ts +++ b/src/util/User.ts
@@ -1,15 +1,19 @@ import { UserModel } from "fosscord-server-util"; import { HTTPError } from "lambert-server"; +export const PublicUserProjection = { + username: true, + discriminator: true, + id: true, + public_flags: true, + avatar: true, +}; + export async function getPublicUser(user_id: bigint, additional_fields?: any) { const user = await UserModel.findOne( { id: user_id }, { - username: true, - discriminator: true, - id: true, - public_flags: true, - avatar: true, + ...PublicUserProjection, ...additional_fields, } ).exec();