added itemlock command, added TNT item, minor bugfixes

This commit is contained in:
2025-07-02 18:10:28 +02:00
parent ac3f81857f
commit a698cb25d5
11 changed files with 82 additions and 9 deletions

View File

@@ -10,6 +10,7 @@ export default new Command('donate', ['donate'], 'chatter', async (msg, user) =>
if (!args[0]) { await sendMessage('Please specify a user', msg.messageId); return; };
const target = await User.initUsername(args[0].toLowerCase());
if (!target) { await sendMessage(`Chatter ${args[0]} doesn't exist`, msg.messageId); return; };
if (target.username === user.username) { await sendMessage("You can't give yourself qweribucks", msg.messageId); return; };
const targetRecord = await getUserRecord(target);
if (!args[1]) { await sendMessage('Please specify the amount of the item you want to give', msg.messageId); return; };
const amount = Number(args[1]);
@@ -18,7 +19,7 @@ export default new Command('donate', ['donate'], 'chatter', async (msg, user) =>
const userRecord = await getUserRecord(user);
if (userRecord.balance < amount) { await sendMessage(`You can't give qweribucks you don't have!`, msg.messageId); return; };
if (await user.itemLock() || await target.itemLock()) { await sendMessage('Cannot give qweribucks. Please try again!', msg.messageId); return; };
if (await user.itemLock() || await target.itemLock()) { await sendMessage('Cannot give qweribucks', msg.messageId); return; };
await Promise.all([
user.setLock(),