Created
March 20, 2025 16:53
-
-
Save KOULIKS94/b1cd2765f4b7f381aae8749d7fdd0003 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const userCoins = {}; | |
| const shopItems = { "VIP Role": 50, "Custom Name": 100 }; | |
| bot( | |
| { | |
| pattern: 'shop', | |
| desc: 'View available shop items', | |
| type: 'group', | |
| }, | |
| async (message) => { | |
| let shopList = '🛍️ *Group Shop*\n\n'; | |
| for (let [item, price] of Object.entries(shopItems)) { | |
| shopList += `💰 *${item}* - ${price} Coins\n`; | |
| } | |
| await message.send(shopList); | |
| } | |
| ); | |
| bot( | |
| { | |
| pattern: 'buy ?(.*)', | |
| desc: 'Buy an item from the shop', | |
| type: 'group', | |
| }, | |
| async (message, match) => { | |
| const user = message.sender; | |
| const itemPrice = shopItems[match]; | |
| if (!itemPrice) return await message.send('⚠️ Item not found! Use `!shop` to view items.'); | |
| if ((userCoins[user] || 0) < itemPrice) return await message.send('❌ Not enough coins!'); | |
| userCoins[user] -= itemPrice; | |
| await message.send(`✅ You purchased *${match}*!`); | |
| } | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment