feat: Implement userService.getOrCreateUser and integrate it across commands, remove old utility scripts, and fix daily bonus calculation.

This commit is contained in:
syntaxbullet
2025-12-08 10:29:40 +01:00
parent 29c0a4752d
commit 866cfab03e
12 changed files with 42 additions and 94 deletions

View File

@@ -15,12 +15,7 @@ export const balance = createCommand({
await interaction.deferReply();
const targetUser = interaction.options.getUser("user") || interaction.user;
const user = await userService.getUserById(targetUser.id);
if (!user) {
await interaction.editReply({ content: "❌ User not found in database." });
return;
}
const user = await userService.getOrCreateUser(targetUser.id, targetUser.username);
const embed = new EmbedBuilder()
.setAuthor({ name: targetUser.username, iconURL: targetUser.displayAvatarURL() })