Skip to content

Economy#7

Open
vmbbi wants to merge 30 commits into
masterfrom
economy
Open

Economy#7
vmbbi wants to merge 30 commits into
masterfrom
economy

Conversation

@vmbbi

@vmbbi vmbbi commented Jul 3, 2026

Copy link
Copy Markdown
Member

added gambling money etc

@vmbbi
vmbbi requested review from drtheodor and rapbattlegod32 July 3, 2026 18:38
Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts
Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts Outdated
@vmbbi
vmbbi requested review from drtheodor and rapbattlegod32 July 4, 2026 06:13

@drtheodor drtheodor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also no leaderboard 😔

Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts Outdated
Comment thread config.json.js Outdated
Comment thread config.json.js Outdated
Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts
Comment thread src/commands/fun/economy.ts Outdated
@rapbattlegod32

Copy link
Copy Markdown
Member
export_1783153248310.mov

@vmbbi
vmbbi requested a review from drtheodor July 4, 2026 10:57
@rapbattlegod32

Copy link
Copy Markdown
Member

are we adding taxes

@drtheodor drtheodor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure everything uses pings instead of plain name mentions and messages use format templates from config as other commands do

as for "could be its own function" comments, all of them could be extracted into a single function and use a single format template from the config

Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts Outdated
default: {
switch (sub) {
case "wage": return await handleWage(interaction);
case "inflation": return await handleInflation(interaction);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same argument as for "add-item" and "remove-item"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mean for wage and inflation or just inflation?

Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/commands/fun/economy.ts Outdated
Comment thread config.json.js Outdated
@vmbbi
vmbbi requested a review from drtheodor July 5, 2026 19:41

@drtheodor drtheodor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pagination should be a separate class/method/utility thing (all for the /search trust) + it should use a more random random

Comment thread src/commands/fun/economy.ts
Comment thread src/commands/fun/economy.ts Outdated
Comment thread src/index.ts
if (interaction.isButton() || interaction.isModalSubmit()) {
const ic = interaction.customId.indexOf(":");
handlerId = interaction.customId.substring(0, ic);
} else if (interaction.isChatInputCommand() || interaction.isAutocomplete()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you remove that
the autocomplete is used for autocompletion
like the thing needed for /economy buy

Comment thread config.json.js Outdated

@drtheodor drtheodor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of storing all shop items in the db only store the ones that are limited amount and only store their id

all shop items should be dictated by the config and nothing else (inflation command has to go)

also make sure inventory items get killed if they no longer exist in the config

@vmbbi
vmbbi requested a review from drtheodor July 10, 2026 05:14
.addTextDisplayComponents(
new TextDisplayBuilder().setContent("🛒 **The Server Shop**\nThe shop is currently empty.")
);
return void await interaction.reply({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt this be editReply?

}
}

await profile.save();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

balance is read then written back whole with no transactiof two commands at once overwrite eacehother


} else {
if (interaction.member.roles.cache.has(item.roleId)) {
return void await interaction.editReply({ content: config.economy.shop.permRoleOwned });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt this be done with six twelve

content: format(config.economy.roulette.openMessage, { userId: interaction.user.id, seconds: customSeconds })
});

const thread = await initialReply.startThread({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrap it so it cant be ran inside of a thread and causes a crash or without create bread perms


slash: (builder) => {
return builder
.setName("economy")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set contexts to guild only

import rnd from "~/util/rnd";
import config from "config.json"; // Update to "../config.json.js" or "~/config.json" if your compiler requires it
import { randomInt } from "crypto";
import { paginate } from "~/util/paginator2"; // FIX: Removed .ts and updated to project path mapping alias

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove ai coments

return `${visualName} x\`${item.quantity}\``;
}).join("\n");

// FIX: Combined everything into a clean, markdown-formatted plain text string

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove ai comment

.setName("buy")
.setDescription("Purchase an item from the shop")
.addStringOption((opt) => opt.setName("item").setDescription("The ID of the item you want to buy (e.g. 'vip_role')").setRequired(true).setAutocomplete(true))
.addIntegerOption((opt) => opt.setName("quantity").setDescription("How many to buy?").setMinValue(1))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has no max

const shopItems = config.economy.shopItems || [];

if (sub === "buy" || sub === "refill") {
const filtered = shopItems.filter(item =>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sold out items still show in autocomplete

const json = container.toJSON();
if (json.components) {
json.components.forEach((comp: any) => {
if (comp.type === 9 && comp.accessory && comp.accessory.type === 2) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are these magic numbers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants