-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
base: main
Are you sure you want to change the base?
Conversation
That's a very helpful function |
@@ -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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change requires a documentation update in .env.example
and:
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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
Testing
To test the new feature, you need to add the following variables to your
.env
file: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