chore: Remove unnecessary comments from profile command, trade interaction handler, inventory service, and scheduler.

This commit is contained in:
syntaxbullet
2025-12-13 14:28:36 +01:00
parent d34e872133
commit f96d81f8a3
4 changed files with 2 additions and 14 deletions

View File

@@ -30,7 +30,7 @@ export const profile = createCommand({
const attachment = new AttachmentBuilder(cardBuffer, { name: 'student-id.png' });
await interaction.editReply({ files: [attachment] }); // Send mostly just the image as requested, or maybe both? User said "show that user's student id". Image is primary.
await interaction.editReply({ files: [attachment] });
}
});

View File

@@ -31,10 +31,7 @@ KyokoClient.on(Events.MessageCreate, async message => {
KyokoClient.on(Events.InteractionCreate, async interaction => {
// Handle Trade Interactions
if (interaction.isButton() || interaction.isStringSelectMenu() || interaction.isModalSubmit()) {
if (interaction.customId.startsWith("trade_") || interaction.customId === "amount") { // "amount" is the text input id, usually interaction wrapper keeps customId of modal?
// Wait, ModalSubmitInteraction customId IS likely 'trade_money_modal'.
// The components INSIDE have IDs. The Interaction has the Modal ID.
// So checking startWith("trade_") is correct for the modal itself.
if (interaction.customId.startsWith("trade_") || interaction.customId === "amount") {
await import("@/modules/trade/trade.interaction").then(m => m.handleTradeInteraction(interaction));
return;
}

View File

@@ -120,13 +120,6 @@ export const inventoryService = {
// Deduct Balance using economy service (passing tx ensures atomicity)
await economyService.modifyUserBalance(userId, -totalPrice, 'PURCHASE', `Bought ${quantity}x ${item.name}`, txFn);
// Add Item (using local logic to keep in same tx, or could refactor addItem to take tx too and call it)
// Let's refactor addItem below to accept tx, then call it here?
// Since we are modifying buyItem, we can just inline the item addition or call addItem if we update it.
// Let's assume we update addItem next. For now, inline the add logic but cleaner.
// Add Item using inner logic or self-call if we refactor properly.
// Calling addItem directly within the same transaction scope:
await inventoryService.addItem(userId, itemId, quantity, txFn);
return { success: true, item, totalPrice };

View File

@@ -39,8 +39,6 @@ export const schedulerService = {
for (const timer of expiredAccess) {
// TODO: Here we would call Discord API to remove roles/overwrites.
// e.g. discordClient.channels.cache.get(timer.metadata.channelId).permissionOverwrites.delete(timer.userId)
const meta = timer.metadata as any;
console.log(`🚫 Revoking access for User ${timer.userId}: Key=${timer.key} (Channel: ${meta?.channelId || 'N/A'})`);