reworked !use and !info, moved functionality from timeout to item

This commit is contained in:
2025-06-25 01:48:17 +02:00
parent 8060aac6a7
commit dc087c3599
5 changed files with 49 additions and 16 deletions

View File

@@ -2,9 +2,9 @@ import { Command, sendMessage } from ".";
import items from "../items";
export default new Command('use', ['use'], [], async (msg, user) => {
const messageparts = msg.messageText.split(' ');
if (!messageparts[1]) { await sendMessage('Please specify an item you would like to use', msg.messageId); return; };
const selection = items.get(messageparts[1].toLowerCase());
if (!selection) { await sendMessage(`'${messageparts[1]}' is not an item`, msg.messageId); return; };
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; };
await selection.execute(msg, user);
});