summary refs log tree commit diff
path: root/api/src/routes/channels/#channel_id/pins.ts
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/routes/channels/#channel_id/pins.ts')
-rw-r--r--api/src/routes/channels/#channel_id/pins.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/api/src/routes/channels/#channel_id/pins.ts b/api/src/routes/channels/#channel_id/pins.ts

index d83e36ed..96a3fdbf 100644 --- a/api/src/routes/channels/#channel_id/pins.ts +++ b/api/src/routes/channels/#channel_id/pins.ts
@@ -14,7 +14,7 @@ router.put("/:message_id", async (req: Request, res: Response) => { // * in dm channels anyone can pin messages -> only check for guilds if (message.guild_id) permission.hasThrow("MANAGE_MESSAGES"); - const pinned_count = await Message.count({ channel_id, pinned: true }); + const pinned_count = await Message.count({ channel: { id: channel_id }, pinned: true }); const { maxPins } = Config.get().limits.channel; if (pinned_count >= maxPins) throw new HTTPError("Max pin count reached: " + maxPins);