Ahora el "en camino" de /dafi lo envía a los interesados#17
Open
xJavii8 wants to merge 2 commits intodafi-um:masterfrom
Open
Ahora el "en camino" de /dafi lo envía a los interesados#17xJavii8 wants to merge 2 commits intodafi-um:masterfrom
xJavii8 wants to merge 2 commits intodafi-um:masterfrom
Conversation
semperedev
requested changes
Nov 1, 2021
semperedev
requested changes
Nov 1, 2021
| ) | ||
|
|
||
| except (TelegramError, AssertionError): | ||
| except: |
Member
There was a problem hiding this comment.
No olvides utilizar las excepciones correctas en el try-except: TelegramError en este caso.
| try: | ||
| for member_id in members_ids: | ||
| for member_id in members_ids: | ||
| try: |
Member
There was a problem hiding this comment.
Cuidado con los espacios en blanco al final de una línea. Para ir rápido: https://stackoverflow.com/a/30884298
| 'No he podido avisarles 😓' | ||
| ) | ||
| return | ||
| 'No he podido avisarles 😓' |
Member
There was a problem hiding this comment.
Cuidado con la indentación, recuerda que tenemos que seguir PEP 8. Para ir rápido: https://flake8.pycqa.org/en/latest/
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.
Hay dos cambios a la vez en este commit:
Antes, por la forma del código, el bot simplemente se saltaba la comprobación de si un mismo usuario ya estaba en DAFI. Esto se traduce en que un mismo usuario podía poner /dafi on las veces que quisiera, que el bot no le avisaba de que ya estaba ahí, lo que también producía un problema a la hora de enviar un mensaje a los interesados, ya que se guardaba el UID de Telegram tantas veces como el usuario pusiera /dafi on y le podía mandar 5, 6, 7 mensajes (o tantas veces como el usuario haya hecho /dafi on) de que x usuario estaba de camino a DAFI.
Ahora, si un usuario dice que está de camino, el bot manda un mensaje de "¡@x está de camino a DAFI!" tan solo a los que estén ahí, no al grupo general.