Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🪙 feat: automatically add start balance #4486

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MSITETOP
Copy link

@MSITETOP MSITETOP commented Oct 21, 2024

Summary

This pull request introduces a new feature for automatic assignment of an initial balance upon user registration. This functionality addresses the related issue #2687.

Change Type

  • New feature (non-breaking change which adds functionality)

Testing

To test the new feature, you need to add the following variables to your .env file:

CHECK_BALANCE=true
START_BALANCE=20000

Where START_BALANCE represents the number of tokens that will be automatically assigned to the user upon registration. After a new user is registered, they will automatically receive 20,000 tokens.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules.

@khfung
Copy link

khfung commented Oct 22, 2024

That's a very helpful function

@danny-avila danny-avila changed the title feat: automatically add start balance 🪙 feat: automatically add start balance Oct 31, 2024
@@ -71,6 +73,16 @@ const createUser = async (data, disableTTL = true, returnUser = false) => {
}

const user = await User.create(userData);

if (isEnabled(process.env.CHECK_BALANCE) && process.env.START_BALANCE) {
Copy link
Owner

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Information about START_BALANCE has been added to the .env file

Copy link
Author

Choose a reason for hiding this comment

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

Information about START_BALANCE has been added to LibreChat-AI/librechat.ai#156

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