Skip to content

Commit

Permalink
refactor(memory): return user data after update/registration
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Dec 15, 2024
1 parent d3aab8f commit 1a592b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/bot/src/database/memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export async function updateMemory(
} else userChar.push(userData);
characters.set(guildId, userChar, userID);
} else characters.set(guildId, [userData], userID);
return userData;
}

export function deleteUserInChar(
Expand Down
4 changes: 2 additions & 2 deletions packages/bot/src/messages/thread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ export async function repostInThread(
damage: damageName,
msgId: [msg.id, thread.id],
};
logger.trace("User Data", userTemplate);
await updateMemory(characters, interaction.guild!.id, userId, ul, {
const userData = await updateMemory(characters, interaction.guild!.id, userId, ul, {
userData: userTemplate,
});
logger.trace("User data updated", userData);
await registerUser(userRegister, interaction, guildData);
}

Expand Down

0 comments on commit 1a592b7

Please sign in to comment.