Merge pull request #1270 from dank074/patch/fix-pins

This commit is contained in:
Madeline 2025-04-10 09:47:17 +10:00 committed by GitHub
commit 39b19d536c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,6 +49,7 @@ router.put(
const message = await Message.findOneOrFail({ const message = await Message.findOneOrFail({
where: { id: message_id }, where: { id: message_id },
relations: ["author"],
}); });
// * in dm channels anyone can pin messages -> only check for guilds // * in dm channels anyone can pin messages -> only check for guilds
@ -133,6 +134,7 @@ router.delete(
const message = await Message.findOneOrFail({ const message = await Message.findOneOrFail({
where: { id: message_id }, where: { id: message_id },
relations: ["author"],
}); });
if (message.guild_id) req.permission?.hasThrow("MANAGE_MESSAGES"); if (message.guild_id) req.permission?.hasThrow("MANAGE_MESSAGES");