Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uniform Codestyle #55

Open
soxidus opened this issue Jan 13, 2020 · 2 comments
Open

Uniform Codestyle #55

soxidus opened this issue Jan 13, 2020 · 2 comments
Assignees
Labels
Milestone

Comments

@soxidus
Copy link
Owner

soxidus commented Jan 13, 2020

We should use a uniform call structure.
Code example:

        if "group" in update.message.chat.type:
            [....

            ...]
       if update.message.chat.type == "private":
            [....

            ...]

either use "in" to check or compare with "==" operator if a field is set to a specific value.

@karacolada
Copy link
Collaborator

Definitely use "in"! I changed this a while ago to support supergroups AND groups and other types of groups (not sure whether there are others, but we should support both since I'm not even sure it needs to be a supergroup anymore since telegram changed group features).

@soxidus soxidus added this to the public milestone Feb 7, 2020
@karacolada karacolada assigned karacolada and unassigned karacolada Mar 4, 2020
@karacolada karacolada self-assigned this Mar 11, 2020
karacolada pushed a commit that referenced this issue Mar 11, 2020
@karacolada
Copy link
Collaborator

I fixed the structure in command functions depicted above in commit bf3d53a.
Keeping this issue open until public milestone is reached if further nonuniform code is found in the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants