pyrobale 0.3.8__py3-none-any.whl → 0.3.8.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -695,6 +695,22 @@ class Client:
695
695
  self.requests_base + "/leaveChat", data={"chat_id": chat_id}
696
696
  )
697
697
  return data.get("ok", False)
698
+
699
+ async def is_joined(self, user_id: int, chat_id: int) -> bool:
700
+ """Check if a user is joined to a chat.
701
+
702
+ Args:
703
+ user_id (int): Unique identifier for the target chat
704
+ chat_id (int): Unique identifier for the target chat
705
+
706
+ Returns:
707
+ bool: True if the user is joined to the chat, False otherwise
708
+ """
709
+ data = await make_post(
710
+ self.requests_base + "/getChatMember",
711
+ data={"chat_id": chat_id, "user_id": user_id},
712
+ )
713
+ return data.get("result", {}).get("status") in ["member", "creator", "administrator"]
698
714
 
699
715
  async def get_chat(self, chat_id: int) -> Chat:
700
716
  """Get up to date information about the chat.
pyrobale/objects/chat.py CHANGED
@@ -386,6 +386,17 @@ class Chat:
386
386
  bool: True on success
387
387
  """
388
388
  return await self.client.leave_chat(chat_id=self.id)
389
+
390
+ async def is_joined(self, user_id: int) -> bool:
391
+ """Check if a user is joined to the chat.
392
+
393
+ Parameters:
394
+ user_id (int): Unique identifier of the target user
395
+
396
+ Returns:
397
+ bool: True if the user is joined to the chat, False otherwise
398
+ """
399
+ return await self.client.is_joined(user_id, self.id)
389
400
 
390
401
  async def pin(self, message_id: int) -> bool:
391
402
  """Pin a message in the chat.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyrobale
3
- Version: 0.3.8
3
+ Version: 0.3.8.5
4
4
  Summary: A python wrapper for bale api
5
5
  Project-URL: github, https://github.com/pyrobale/pyrobale
6
6
  Project-URL: website, https://pyrobale.github.io
@@ -1,6 +1,6 @@
1
1
  pyrobale/__init__.py,sha256=tC4gr6RIg4tYdzoBDFQCU2CDigXytc-MQ7yH6BJzTzM,3651
2
2
  pyrobale/StateMachine/__init__.py,sha256=TRCBwcr4UlnpU2Olik0vOtNASUOK7_O6RMAG6RrVYlM,1911
3
- pyrobale/client/__init__.py,sha256=xl7TyimdjJLLEPmhpRGV_0-JIN8hCPISmYwle7a6eSI,45539
3
+ pyrobale/client/__init__.py,sha256=nqDGbtMGO9upDxF0EGg6kIS3u2kP3OdqLekIgNMHcrI,46170
4
4
  pyrobale/exceptions/__init__.py,sha256=oa412OuokRm9Vf3XlCJLqpZjz9ZcuxAKxnEBvOK7u2M,21
5
5
  pyrobale/exceptions/common.py,sha256=6ubWjGNmbRbNuzM_ohPuLvGhLdCiCZ-RscEERnv3JMA,273
6
6
  pyrobale/filters/__init__.py,sha256=Q-VFK1U5W9jMWneAqNLNlYSTZI2gjnAkwA-lcqF9GbU,55
@@ -10,7 +10,7 @@ pyrobale/objects/__init__.py,sha256=uy0xBJc5d-1TnlPD6CgxAaUjBnIvQs-GuAgLeEKoXSQ,
10
10
  pyrobale/objects/animation.py,sha256=jpM9V8AOaGLWkcENTDmsxKf57Abf-MArYBLfU6GwkD0,978
11
11
  pyrobale/objects/audio.py,sha256=q14wz5WpC3SgKZkAlH-D9M554RYQNDwuCT2z7v7IZYU,696
12
12
  pyrobale/objects/callbackquery.py,sha256=jALmTVXU6tc6OppTTrhGERCzugzazYrT39AhhGE-UeI,1018
13
- pyrobale/objects/chat.py,sha256=gQ1wpmB63Ot51aeSBAiWzbw9lFgCpJjlm9hlYNBQJ88,16566
13
+ pyrobale/objects/chat.py,sha256=w9_RyluyavgqLET5buArZWOPjKUNhj1RaINQyNhbY-A,16940
14
14
  pyrobale/objects/chatmember.py,sha256=IyAGmuZZ5HlJVYjrfXEKbLoNc7etMytrK-gOeKKo0CU,6895
15
15
  pyrobale/objects/chatphoto.py,sha256=vOb5xzpr3oBiCloi2_ufBnVlUfmcPqSTmMMMTTBYdJo,533
16
16
  pyrobale/objects/contact.py,sha256=6LDxT5RoGbY5Tsw64lg5-jvKSRmmvOiIJha1HqdTaG4,411
@@ -41,7 +41,7 @@ pyrobale/objects/video.py,sha256=DuZMGHio_w8yQvi87Vc3XpJOpEaltkM4_bNRSeocPZo,509
41
41
  pyrobale/objects/voice.py,sha256=ZdsJFH2IsBwelEk4rb4oZfX9xrfJ2_DgfjsMc0e4Tmg,148
42
42
  pyrobale/objects/webappdata.py,sha256=QlZlCa8Mylt8VmcdgdoHeyita5CVnz2WsT1yueEY1tY,78
43
43
  pyrobale/objects/webappinfo.py,sha256=qnTvfNqx91Yzbc1gO5y4XQ3w6g0RpMUqMuF5wk_EZMc,75
44
- pyrobale-0.3.8.dist-info/METADATA,sha256=386ZydRqEYd61G8-SgfJH_3eTz4YnNFgcb0l-nhp80A,5262
45
- pyrobale-0.3.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
46
- pyrobale-0.3.8.dist-info/licenses/LICENSE,sha256=rf_1ZkId-bcjw1kHBq6bV5t5TVob3RgjUyjfKr1CHAk,1070
47
- pyrobale-0.3.8.dist-info/RECORD,,
44
+ pyrobale-0.3.8.5.dist-info/METADATA,sha256=rhG0AYJcUhoaFdSS5fpxry2ji3YX5nW3VSthqHQ3byk,5264
45
+ pyrobale-0.3.8.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
46
+ pyrobale-0.3.8.5.dist-info/licenses/LICENSE,sha256=rf_1ZkId-bcjw1kHBq6bV5t5TVob3RgjUyjfKr1CHAk,1070
47
+ pyrobale-0.3.8.5.dist-info/RECORD,,