summary refs log tree commit diff
path: root/src/util/User.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-14 15:01:53 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-14 15:01:53 +0200
commit6ac4067c39cdcae1cef1718273aaa8796460ffd9 (patch)
tree753cb7c53c914f33e989849753d1ef97767603f6 /src/util/User.ts
parent:bug: fix message schema (diff)
parent:sparkles: add npm i fosscord-server-util to postinstall (diff)
downloadserver-6ac4067c39cdcae1cef1718273aaa8796460ffd9.tar.xz
Merge branch 'master' of https://github.com/discord-open-source/discord-api
Diffstat (limited to 'src/util/User.ts')
-rw-r--r--src/util/User.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/User.ts b/src/util/User.ts

index 1b13e153..05213642 100644 --- a/src/util/User.ts +++ b/src/util/User.ts
@@ -1,4 +1,4 @@ -import { UserModel } from "fosscord-server-util"; +import { toObject, UserModel } from "fosscord-server-util"; import { HTTPError } from "lambert-server"; export const PublicUserProjection = { @@ -9,7 +9,7 @@ export const PublicUserProjection = { avatar: true, }; -export async function getPublicUser(user_id: bigint, additional_fields?: any) { +export async function getPublicUser(user_id: string, additional_fields?: any) { const user = await UserModel.findOne( { id: user_id }, { @@ -18,5 +18,5 @@ export async function getPublicUser(user_id: bigint, additional_fields?: any) { } ).exec(); if (!user) throw new HTTPError("User not found", 404); - return user; + return toObject(user); }