py-tgcalls 2.2.7__py3-none-any.whl → 2.2.8__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py-tgcalls
3
- Version: 2.2.7
3
+ Version: 2.2.8
4
4
  Summary: Async client API for the Telegram Calls.
5
5
  Author-email: Laky-64 <iraci.matteo@gmail.com>
6
6
  Project-URL: Homepage, https://pytgcalls.github.io/
@@ -1,6 +1,6 @@
1
- py_tgcalls-2.2.7.dist-info/licenses/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
1
+ py_tgcalls-2.2.8.dist-info/licenses/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
2
2
  pytgcalls/__init__.py,sha256=qbfwN7rYwIdCegMOzdcbvwazeNjDzgmowgcqLFNqKIM,308
3
- pytgcalls/__version__.py,sha256=_a_I7cjpwo5jHaXCQYkNQgSKbe2WWcxvqM6NIPlZ27w,22
3
+ pytgcalls/__version__.py,sha256=IqD9h-jsDDriviuNsOqmA0rXPSWRSWW_V-IX7uKeRnk,22
4
4
  pytgcalls/chat_lock.py,sha256=u3t0G3EQ20zn89Sn5s-GWFFX9Xmu4gYWkAgzHJOk0Mc,762
5
5
  pytgcalls/environment.py,sha256=ctCHACvG6l8SdpPewSBhOvc70kbwpv18maC0TwLvZ08,1924
6
6
  pytgcalls/exceptions.py,sha256=Rijc-8T93WEWJxNW9jncU8_M6mYZZZcs8F2bqitEIeI,3787
@@ -71,12 +71,12 @@ pytgcalls/methods/utilities/run.py,sha256=cnYQd2xB5Cr_WS0Q2cXJZPGiN6JOCULzj1r4xX
71
71
  pytgcalls/methods/utilities/start.py,sha256=mn0kQZhTUuc-9CCJDbFIVsEtJ8kfnfZOGbVC505qVRM,3232
72
72
  pytgcalls/methods/utilities/stream_params.py,sha256=PUnctLhdCeBAg52v95vpxj-42Le5XzbnRtcfm71FDBM,3341
73
73
  pytgcalls/mtproto/__init__.py,sha256=X4zvzFG7km7qHyE0fdvA550WcOVO_xl_p__gvIfDGmw,130
74
- pytgcalls/mtproto/bridged_client.py,sha256=Qb9-9FrUdh3g_sx-JOcvkzv3kJtS_pz2Qaos85DgVPI,8280
74
+ pytgcalls/mtproto/bridged_client.py,sha256=E0DLhZd-x7Uxyf6nFaTZ73COLB6BnXHzsBgqwWGHwEQ,8476
75
75
  pytgcalls/mtproto/client_cache.py,sha256=5unu8sjLRaIKoEgJGaIRjhA4P3U2lFpfakTKFxKLzAM,5591
76
- pytgcalls/mtproto/hydrogram_client.py,sha256=Fzg2JCAozadQA3KdkN2psHxW7vyps_SGhYfbpegTV-4,29525
76
+ pytgcalls/mtproto/hydrogram_client.py,sha256=ocypZa8uH3VvSmgWE8I5rAvFs4VJ3yBphPXghB1vZyI,30019
77
77
  pytgcalls/mtproto/mtproto_client.py,sha256=9SIG3DNeICIXvggyVE8DQWtToPtxV0t9ZKr6dEMnEMg,8783
78
- pytgcalls/mtproto/pyrogram_client.py,sha256=gu2Aru9jwXy2GkgfVTh2kRKHi6CzAEJdFr5rD_D67uQ,29512
79
- pytgcalls/mtproto/telethon_client.py,sha256=NQk4aB0l2G5t1pJ7f6YvW3cvw9ykhuVYDSXsykPqQXA,27845
78
+ pytgcalls/mtproto/pyrogram_client.py,sha256=iyygyyh7pN0xCqLF50fA48lgLsucw7awogWCd5tOmLc,30005
79
+ pytgcalls/mtproto/telethon_client.py,sha256=DHtGbSqqjMMqrIyDKWdrK3NUoWX3i_tYQm9oYJQ1-vA,28172
80
80
  pytgcalls/types/__init__.py,sha256=GlgBBXAwbNopXSeTTmiXktrEJhhN_rMBtuAllTBbN3k,1189
81
81
  pytgcalls/types/browsers.py,sha256=47Kr5q96n4Q4WvVhA6IUlS2egEcA9GRLlDeFcQYyc9M,9545
82
82
  pytgcalls/types/cache.py,sha256=nJh6B7xnvAiLh0mDJYS9sYhnRvj0BqxrQBLXs4WEUMs,1235
@@ -117,7 +117,7 @@ pytgcalls/types/stream/record_stream.py,sha256=f4VQ6MY8HtOxt7vz0hWBFmbbAIvTRHpAI
117
117
  pytgcalls/types/stream/stream_ended.py,sha256=xR_kZwFf03hA6rw_nvI7Be7GwoCKzQf_1MKaGpPDXqY,716
118
118
  pytgcalls/types/stream/stream_frames.py,sha256=028ZhNV-mN3BGqMlmxusAV1xDQpXRYCeM0WXBZhRUhA,446
119
119
  pytgcalls/types/stream/video_quality.py,sha256=eMCBFPwh5meX3UVEaozcGlwmgaujfpiTa3vBVSBBP_8,275
120
- py_tgcalls-2.2.7.dist-info/METADATA,sha256=xFDEczlK5psCyUuWXkUzpmvFbjvdlM8CT7eceK-5SCk,5280
121
- py_tgcalls-2.2.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
122
- py_tgcalls-2.2.7.dist-info/top_level.txt,sha256=IUDUwn0KkcbUYZbCe9R5AUb2Ob-lmllNUGQqyeXXd8A,10
123
- py_tgcalls-2.2.7.dist-info/RECORD,,
120
+ py_tgcalls-2.2.8.dist-info/METADATA,sha256=ES6Bwhsvi1yPMrVGm9cW03FNWRCtW-fuzQApJVLBPeQ,5280
121
+ py_tgcalls-2.2.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
122
+ py_tgcalls-2.2.8.dist-info/top_level.txt,sha256=IUDUwn0KkcbUYZbCe9R5AUb2Ob-lmllNUGQqyeXXd8A,10
123
+ py_tgcalls-2.2.8.dist-info/RECORD,,
pytgcalls/__version__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '2.2.7'
1
+ __version__ = '2.2.8'
@@ -248,18 +248,20 @@ class BridgedClient(HandlersHolder):
248
248
  return GroupCallParticipant.Action.UPDATED
249
249
 
250
250
  @staticmethod
251
- def chat_id(input_peer) -> int:
251
+ def chat_id(input_peer, readable: bool = True) -> int:
252
252
  class_name = input_peer.__class__.__name__
253
253
  if class_name in ['PeerUser', 'InputPeerUser']:
254
254
  return input_peer.user_id
255
255
  elif class_name in ['Channel', 'ChannelForbidden']:
256
- return -1000000000000 - input_peer.id
256
+ return -1000000000000 - input_peer.id \
257
+ if readable else input_peer.id
257
258
  elif hasattr(input_peer, 'channel_id'):
258
- return -1000000000000 - input_peer.channel_id
259
+ return -1000000000000 - input_peer.channel_id \
260
+ if readable else input_peer.channel_id
259
261
  elif class_name == 'Chat':
260
- return -input_peer.id
262
+ return -input_peer.id if readable else input_peer.id
261
263
  else:
262
- return -input_peer.chat_id
264
+ return -input_peer.chat_id if readable else input_peer.chat_id
263
265
 
264
266
  @staticmethod
265
267
  def user_from_call(call) -> Optional[int]:
@@ -60,6 +60,7 @@ from hydrogram.raw.types import PhoneCallProtocol
60
60
  from hydrogram.raw.types import PhoneCallRequested
61
61
  from hydrogram.raw.types import PhoneCallWaiting
62
62
  from hydrogram.raw.types import UpdateChannel
63
+ from hydrogram.raw.types import UpdateChat
63
64
  from hydrogram.raw.types import UpdateGroupCall
64
65
  from hydrogram.raw.types import UpdateGroupCallConnection
65
66
  from hydrogram.raw.types import UpdateGroupCallParticipants
@@ -234,13 +235,21 @@ class HydrogramClient(BridgedClient):
234
235
  )
235
236
  if isinstance(
236
237
  update,
237
- UpdateChannel,
238
+ (
239
+ UpdateChannel,
240
+ UpdateChat,
241
+ ),
238
242
  ):
239
243
  chat_id = self.chat_id(update)
240
244
  if len(chats) > 0:
241
245
  if isinstance(
242
- chats[update.channel_id],
243
- ChannelForbidden,
246
+ chats[
247
+ self.chat_id(
248
+ update,
249
+ False,
250
+ )
251
+ ],
252
+ (ChannelForbidden, ChatForbidden),
244
253
  ):
245
254
  self._cache.drop_cache(chat_id)
246
255
  await self._propagate(
@@ -282,7 +291,12 @@ class HydrogramClient(BridgedClient):
282
291
  ),
283
292
  ):
284
293
  if isinstance(
285
- chats[update.message.peer_id.chat_id],
294
+ chats[
295
+ self.chat_id(
296
+ update.message.peer_id,
297
+ False,
298
+ )
299
+ ],
286
300
  (
287
301
  ChatForbidden,
288
302
  ChannelForbidden,
@@ -63,6 +63,7 @@ from pyrogram.raw.types import PhoneCallProtocol
63
63
  from pyrogram.raw.types import PhoneCallRequested
64
64
  from pyrogram.raw.types import PhoneCallWaiting
65
65
  from pyrogram.raw.types import UpdateChannel
66
+ from pyrogram.raw.types import UpdateChat
66
67
  from pyrogram.raw.types import UpdateGroupCall
67
68
  from pyrogram.raw.types import UpdateGroupCallConnection
68
69
  from pyrogram.raw.types import UpdateGroupCallParticipants
@@ -235,13 +236,21 @@ class PyrogramClient(BridgedClient):
235
236
  )
236
237
  if isinstance(
237
238
  update,
238
- UpdateChannel,
239
+ (
240
+ UpdateChannel,
241
+ UpdateChat,
242
+ ),
239
243
  ):
240
244
  chat_id = self.chat_id(update)
241
245
  if len(chats) > 0:
242
246
  if isinstance(
243
- chats[update.channel_id],
244
- ChannelForbidden,
247
+ chats[
248
+ self.chat_id(
249
+ update,
250
+ False,
251
+ )
252
+ ],
253
+ (ChannelForbidden, ChatForbidden),
245
254
  ):
246
255
  self._cache.drop_cache(chat_id)
247
256
  await self._propagate(
@@ -283,7 +292,12 @@ class PyrogramClient(BridgedClient):
283
292
  ),
284
293
  ):
285
294
  if isinstance(
286
- chats[update.message.peer_id.chat_id],
295
+ chats[
296
+ self.chat_id(
297
+ update.message.peer_id,
298
+ False,
299
+ )
300
+ ],
287
301
  (
288
302
  ChatForbidden,
289
303
  ChannelForbidden,
@@ -8,6 +8,7 @@ from ntgcalls import Protocol
8
8
  from telethon import TelegramClient
9
9
  from telethon.errors import BadRequestError
10
10
  from telethon.errors import ChannelPrivateError
11
+ from telethon.errors import ChatForbiddenError
11
12
  from telethon.errors import FileMigrateError
12
13
  from telethon.errors import FloodWaitError
13
14
  from telethon.errors import GroupcallForbiddenError
@@ -59,6 +60,7 @@ from telethon.tl.types import TypeInputChannel
59
60
  from telethon.tl.types import TypeInputPeer
60
61
  from telethon.tl.types import TypeInputUser
61
62
  from telethon.tl.types import UpdateChannel
63
+ from telethon.tl.types import UpdateChat
62
64
  from telethon.tl.types import UpdateGroupCall
63
65
  from telethon.tl.types import UpdateGroupCallConnection
64
66
  from telethon.tl.types import UpdateGroupCallParticipants
@@ -234,14 +236,19 @@ class TelethonClient(BridgedClient):
234
236
  )
235
237
  if isinstance(
236
238
  update,
237
- UpdateChannel,
239
+ (
240
+ UpdateChannel,
241
+ UpdateChat,
242
+ ),
238
243
  ):
239
244
  chat_id = self.chat_id(update)
240
245
  try:
241
246
  await self._app.get_entity(
242
- PeerChannel(chat_id),
247
+ PeerChannel(chat_id)
248
+ if isinstance(update, UpdateChannel)
249
+ else PeerChat(chat_id),
243
250
  )
244
- except ChannelPrivateError:
251
+ except (ChannelPrivateError, ChatForbiddenError):
245
252
  self._cache.drop_cache(chat_id)
246
253
  await self._propagate(
247
254
  ChatUpdate(
@@ -270,19 +277,19 @@ class TelethonClient(BridgedClient):
270
277
  update.message.action,
271
278
  ),
272
279
  )
273
- if isinstance(update.message.out, bool):
274
- if update.message.out:
275
- self._cache.drop_cache(chat_id)
276
- await self._propagate(
277
- ChatUpdate(
278
- chat_id,
279
- ChatUpdate.Status.LEFT_GROUP,
280
- ),
281
- )
282
280
  if isinstance(
283
281
  update.message.action,
284
282
  MessageActionChatDeleteUser,
285
283
  ):
284
+ if isinstance(update.message.out, bool):
285
+ if update.message.out:
286
+ self._cache.drop_cache(chat_id)
287
+ await self._propagate(
288
+ ChatUpdate(
289
+ chat_id,
290
+ ChatUpdate.Status.LEFT_GROUP,
291
+ ),
292
+ )
286
293
  if isinstance(
287
294
  update.message.peer_id,
288
295
  (