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

Add balance functions to stats command #103

Merged
merged 6 commits into from
Mar 26, 2023

Conversation

AlexHTW
Copy link
Contributor

@AlexHTW AlexHTW commented Mar 23, 2023

Could probably optimize a bit by calling get_remaining_budget in is_within_budget, not sure if the redundancy is too bad right now.

@AlexHTW AlexHTW mentioned this pull request Mar 23, 2023
@AlexHTW
Copy link
Contributor Author

AlexHTW commented Mar 23, 2023

The grant balance output could also include the expiration date, let me know if I should add it.

@AlexHTW AlexHTW marked this pull request as draft March 24, 2023 16:25
@AlexHTW
Copy link
Contributor Author

AlexHTW commented Mar 24, 2023

Probably better to explicitly list admin(s) in the .env, will test and update PR soon.

updated functions accordingly
improved (?) stats output look
@AlexHTW AlexHTW marked this pull request as ready for review March 24, 2023 23:14
@AlexHTW
Copy link
Contributor Author

AlexHTW commented Mar 24, 2023

Added ADMIN_USER_IDS to .env, user ids here have the same access as ALLOWED_TELEGRAM_USER_IDS but without budget restrictions.
is_admin function can be used for future admin exclusive commands (like #108).
For now only used to add the OpenAI grant and billing info to admin's stats command.

@n3d1117
Copy link
Owner

n3d1117 commented Mar 26, 2023

Thanks @AlexHTW, looks good!

@n3d1117 n3d1117 merged commit 1a87a44 into n3d1117:main Mar 26, 2023
@AlexHTW
Copy link
Contributor Author

AlexHTW commented Mar 26, 2023

Thanks for the merge and the new release @n3d1117 !
Could you please also credit @deanxizian in the release notes for this part?

@n3d1117
Copy link
Owner

n3d1117 commented Mar 26, 2023

Could you please also credit @deanxizian in the release notes for this part?

Done! Sorry, release notes were auto-generated

@AlexHTW AlexHTW deleted the add-balance-function branch March 27, 2023 20:53
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.

None yet

3 participants