question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove if condition in _run_handlers

See original GitHub issue

Hi

The if condition in _run_handlers is creating issues, when I try to test tgvoip example. I modified it as


    def _run_handlers(self, update: Dict[Any, Any]) -> None:
        if update.get('@type') == 'updateNewMessage':
            for handler in self._message_handlers:
                self._workers_queue.put(
                    (handler, update),
                    timeout=self._queue_put_timeout,
                )
        else:
            
            for handler in self._message_handlers:
                self._workers_queue.put(
                    (handler, update),
                    timeout=self._queue_put_timeout,
                )

or we can create another method for add_message_handler like add_call_handlerand append functions to new list like _call_handler. In else condition use it.

If ok, I can create a PR.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sekarpdktcommented, Dec 27, 2018

Ok. Thanks for suggestion. Will do it this weekend and let u know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove entries in a python set based on condition
One way to approach this would be to iterate through the set and create an array for the elements which fulfill the conditions...
Read more >
Remove a list element based on condition
Also, I would like to combine conditions to check if the element does not contain any of a list of variables, and remove...
Read more >
Remove array elements if a certain condition is met with a for ...
I am trying to use a for loop to find the values between -2.5 to 2.5 in the first two columns of a...
Read more >
Conditionally Remove Row from Data Frame in R (3 Examples)
Our example data contains five rows and three columns. Example 1: Remove Row Based on Single Condition. If we want to delete one...
Read more >
Testing API | Visual Studio Code Extension API
Testing APIs in VS Code allow users to discover and run unit tests in their workspace.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found