Closed Thajudecodes closed 1 year ago
Which errors you have cleared in this pull request?
Avoid using except Exception as e as it is too broad and catches too many exceptions, making it difficult to understand what went wrong.
Use the with statement to automatically close the user-bot client instead of manually closing it.
3.Consider using async for to iterate over the chat history as it's an asynchronous operation.
4.Use the async with statement for lock instead of using a lock instance.
$ Sorry i cant tell that it is errors but i improved the code by a little bit . Condider , all into you
If you check code properly, already async context manager is used for user-bot client and async lock. Also async for loop is used for get_history function.
Incase error occurs, except Exception will only call once and Python logging module will log error to track what is went wrong.
I don't see any functional improvement in this PR, thus closing it.
I have cleared some of the main errors chek it out