diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-01-05 17:12:21 +1100 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-01-05 17:16:55 +1100 |
commit | df449169bde6c0576757700f68f2d406139cc846 (patch) | |
tree | f8bcbaf30ed3ed007d392a51614a134e543e3c17 /src/api/routes/guilds/#guild_id/messages | |
parent | channel flags whoops (diff) | |
download | server-df449169bde6c0576757700f68f2d406139cc846.tar.xz |
Prettier
Diffstat (limited to 'src/api/routes/guilds/#guild_id/messages')
-rw-r--r-- | src/api/routes/guilds/#guild_id/messages/search.ts | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/api/routes/guilds/#guild_id/messages/search.ts b/src/api/routes/guilds/#guild_id/messages/search.ts index ccee59f7..88488871 100644 --- a/src/api/routes/guilds/#guild_id/messages/search.ts +++ b/src/api/routes/guilds/#guild_id/messages/search.ts @@ -72,12 +72,20 @@ router.get("/", route({}), async (req: Request, res: Response) => { if (channel_id) query.where!.channel = { id: channel_id }; else { // get all channel IDs that this user can access - const channels = await Channel.find({ where: { guild_id: req.params.guild_id }, select: ["id"] }); + const channels = await Channel.find({ + where: { guild_id: req.params.guild_id }, + select: ["id"], + }); const ids = []; for (var channel of channels) { - const perm = await getPermission(req.user_id, req.params.guild_id, channel.id); - if (!perm.has("VIEW_CHANNEL") || !perm.has("READ_MESSAGE_HISTORY")) continue; + const perm = await getPermission( + req.user_id, + req.params.guild_id, + channel.id, + ); + if (!perm.has("VIEW_CHANNEL") || !perm.has("READ_MESSAGE_HISTORY")) + continue; ids.push(channel.id); } |