found the chat i was searching for ?  or shall I return/break when found the right element ?
                  
                  
                  
                  
                  
                  gen = client.iter_dialogs()
                  
                  
                  async for dialog in gen:
                  
                  
                      if dialog.id == SOME_ID:
                  
                  
                              #do stuff
                  
                  
                      gen.STOP_SOMEHOW()
                  
                  
                
you can use "break" to stop the loop
Yes yes I found it thanks! I was thinking there is a method to call on the generator to stop it but it's just 'break'
break
Обсуждают сегодня