fix argument of type 'float' is not iterable (#211)

* fix argument of type 'float' is not iterable

fix "argument of type 'float' is not iterable" in show_balance_handle and message_handle

* Update bot.py
This commit is contained in:
TanNhatCMS
2023-06-20 15:50:03 +07:00
committed by GitHub
parent e42798c0ce
commit 8df5e2d24d
+1 -1
View File
@@ -94,7 +94,7 @@ async def register_user_if_not_exists(update: Update, context: CallbackContext,
# back compatibility for n_used_tokens field
n_used_tokens = db.get_user_attribute(user.id, "n_used_tokens")
if isinstance(n_used_tokens, int): # old format
if isinstance(n_used_tokens, int) or isinstance(n_used_tokens, float): # old format
new_n_used_tokens = {
"gpt-3.5-turbo": {
"n_input_tokens": 0,