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.
So, originally I just wanted to add the admin list to the loop that checks if an allowed user is in the group (first commit).
But then discovered a bug in
is_user_in_group
, it only checks the first user of the allowed user list (in all my previous testing, I never put myself in a different position until I tested the addition of the admin list 🙈)The current implementation of
is_user_in_group
raises an error if the first allowed user is not in the group and doesn't continue with the other users.My fix is using the context (now that I think about it, maybe it would work with the previous implementation as well, if the error would be caught), so I added it to
is_allowed
andis_within_budget
.I gotta say, I am a bit out of my depth with the best practices of the telegram library. But for my tests it all seems to be at least functional now.