Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Add get_chat_onlines method#654

Merged
delivrance merged 1 commit into
pyrogram:get-chat-online-countfrom
AndrielFR:master
May 12, 2021
Merged

Add get_chat_onlines method#654
delivrance merged 1 commit into
pyrogram:get-chat-online-countfrom
AndrielFR:master

Conversation

@AndrielFR

Copy link
Copy Markdown

Used to get the number of online users in a specific group.

async def get_chat_onlines(
self,
chat_id: Union[int, str]
) -> Optional[int]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function does not return None. Just int or raise an exception.

Suggested change
) -> Optional[int]:
) -> int:

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😳

# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.

from typing import Optional, Union

@alissonlauffer alissonlauffer Apr 4, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import when applying the suggestion below.

Suggested change
from typing import Optional, Union
from typing import Union

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@delivrance delivrance left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_chat_online_count sounds better to me.

@delivrance delivrance changed the base branch from master to get-chat-online-count May 12, 2021 07:28
@delivrance delivrance merged commit 808c629 into pyrogram:get-chat-online-count May 12, 2021
delivrance added a commit that referenced this pull request May 12, 2021
commit d6dcf98d7445cbdc2a036deca57207c14bc354fc
Author: Dan <14043624+delivrance@users.noreply.github.com>
Date:   Wed May 12 09:35:18 2021 +0200

    Rename get_chat_onlines to get_chat_online_count

commit 21ff2a39d856ebc939ce9b15810198c82a9c23c6
Merge: 808c629 29701a3
Author: Dan <14043624+delivrance@users.noreply.github.com>
Date:   Wed May 12 09:32:59 2021 +0200

    Merge branch 'master' into get-chat-online-count

commit 808c629
Author: Andriel Rodrigues <andrielkogama2@gmail.com>
Date:   Wed May 12 04:28:53 2021 -0300

    Add get_chat_online_count method (todo) (#654)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants