feat: add role check for staff commands and fix weird json parsing crash

This commit is contained in:
Pihkaal
2025-07-28 22:31:51 +02:00
parent 81cffc28c8
commit f500bd81ad
2 changed files with 14 additions and 16 deletions

View File

@@ -146,7 +146,7 @@ client.on("ready", async (client) => {
});
client.on("messageCreate", async (message) => {
if (message.author.bot) return;
if (message.author.bot || !message.member) return;
if (message.content.startsWith(`<@${client.user!.id}>`)) {
const [command, ...args] = message.content
@@ -173,6 +173,13 @@ client.on("messageCreate", async (message) => {
);
} else {
if (args.length === 2) {
if (!message.member.roles.cache.has("1147963065640439900")) {
await message.reply(
"Tu t'es cru chez mémé ou quoi faut être staff",
);
return;
}
if (
(args[1][0] !== "+" && args[1][0] !== "-") ||
!args[1] ||