refactor: yes#8
Open
Commenter25 wants to merge 9 commits into
Open
Conversation
makes it easier to read top to bottom
avoids constantly repeating `bot_handler.send_reply(message, [...])` and makes the code a lot easier to read
especially now that the syntax is so cut down, it really doesn't make a lot of sense to have a whole extra function call to separate these. plus, "_validate_content_tokens" is rather confusing, it sounds more general than being a timeout specific function
in a similar vein, this isn't inherently timeout specific changing the variable name is totally a nitpick, but imo it only makes sense in the context of handle_message, outside of it the thought becomes "what content?"
a whole lot of repetition here that makes it difficult to read. made much easier by removing all that and making the consistently-sized error code the first param also, the structure was inconsistent and didn't match the format in zulip documentation. you can see the structure at the top, and what a successful message looks like at the bottom (notice msg is blank) https://zulip.com/api/rest-error-handling
keeps things type-safe, ensures consistency, and reduces verbosity
Up to standards ✅🟢 Issues
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
round-3.mp4