mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-19 08:41:39 +01:00
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:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user