disabled items can no longer be used with !use, admingive is now disableable, removed command specific intents, simplified command permission system

This commit is contained in:
2025-06-29 15:26:03 +02:00
parent 773a694714
commit 898e0b7b70
23 changed files with 72 additions and 85 deletions

View File

@@ -1,10 +1,12 @@
import { redis } from "bun";
import { Command, sendMessage } from ".";
import items from "../items";
export default new Command('use', ['use'], [], async (msg, user) => {
export default new Command('use', ['use'], 'chatter', async (msg, user) => {
const messagequery = msg.messageText.trim().split(' ').slice(1);
if (!messagequery[0]) { await sendMessage('Please specify an item you would like to use', msg.messageId); return; };
const selection = items.get(messagequery[0].toLowerCase());
if (!selection) { await sendMessage(`'${messagequery[0]}' is not an item`, msg.messageId); return; };
if (await redis.sismember('disabledcommands', selection.name)) { await sendMessage(`The ${selection.prettyName} item is disabled`, msg.messageId); return; };
await selection.execute(msg, user);
});