multibotkit 0.1.26__tar.gz → 0.1.28__tar.gz

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.
Files changed (44) hide show
  1. {multibotkit-0.1.26 → multibotkit-0.1.28}/PKG-INFO +1 -1
  2. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/dispatchers/telegram.py +10 -2
  3. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/helpers/telegram.py +100 -0
  4. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit.egg-info/PKG-INFO +1 -1
  5. {multibotkit-0.1.26 → multibotkit-0.1.28}/setup.py +1 -1
  6. {multibotkit-0.1.26 → multibotkit-0.1.28}/LICENSE +0 -0
  7. {multibotkit-0.1.26 → multibotkit-0.1.28}/README.md +0 -0
  8. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/__init__.py +0 -0
  9. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/dispatchers/__init__.py +0 -0
  10. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/dispatchers/base_dispatcher.py +0 -0
  11. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/dispatchers/fb.py +0 -0
  12. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/dispatchers/viber.py +0 -0
  13. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/dispatchers/vk.py +0 -0
  14. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/helpers/__init__.py +0 -0
  15. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/helpers/base_helper.py +0 -0
  16. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/helpers/fb.py +0 -0
  17. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/helpers/viber.py +0 -0
  18. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/helpers/vk.py +0 -0
  19. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/__init__.py +0 -0
  20. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/fb/__init__.py +0 -0
  21. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/fb/incoming.py +0 -0
  22. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/fb/outgoing.py +0 -0
  23. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/telegram/__init__.py +0 -0
  24. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/telegram/incoming.py +0 -0
  25. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/telegram/outgoing.py +0 -0
  26. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/viber/__init__.py +0 -0
  27. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/viber/incoming.py +0 -0
  28. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/viber/outgoing.py +0 -0
  29. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/vk/__init__.py +0 -0
  30. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/vk/incoming.py +0 -0
  31. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/schemas/vk/outgoing.py +0 -0
  32. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/states/__init__.py +0 -0
  33. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/states/managers/__init__.py +0 -0
  34. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/states/managers/base.py +0 -0
  35. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/states/managers/memory.py +0 -0
  36. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/states/managers/mongo.py +0 -0
  37. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/states/managers/redis.py +0 -0
  38. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit/states/state.py +0 -0
  39. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit.egg-info/SOURCES.txt +0 -0
  40. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit.egg-info/dependency_links.txt +0 -0
  41. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit.egg-info/requires.txt +0 -0
  42. {multibotkit-0.1.26 → multibotkit-0.1.28}/multibotkit.egg-info/top_level.txt +0 -0
  43. {multibotkit-0.1.26 → multibotkit-0.1.28}/pyproject.toml +0 -0
  44. {multibotkit-0.1.26 → multibotkit-0.1.28}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: multibotkit
3
- Version: 0.1.26
3
+ Version: 0.1.28
4
4
  Summary: Functional library for developing multiplatform chatbots
5
5
  Home-page: https://github.com/Appvelox/multibotkit
6
6
  Author: Appvelox LLC
@@ -11,9 +11,17 @@ class TelegramDispatcher(BaseDispatcher):
11
11
  ):
12
12
  if event.message is not None:
13
13
  sender_id = event.message.from_.id
14
- if event.callback_query is not None:
14
+ elif event.callback_query is not None:
15
15
  sender_id = event.callback_query.from_.id
16
-
16
+ elif event.chat_member is not None:
17
+ sender_id = event.chat_member.from_.id
18
+ elif event.chat_join_request is not None:
19
+ sender_id = event.chat_join_request.from_.id
20
+ elif event.my_chat_member is not None:
21
+ sender_id = event.my_chat_member.from_.id
22
+ else:
23
+ sender_id = None
24
+
17
25
  state_id = f"telegram_{sender_id}"
18
26
  state_object = await self.state_manager.get_state(state_id)
19
27
 
@@ -228,6 +228,26 @@ class TelegramHelper(BaseHelper):
228
228
  r = await self._perform_async_request(url, data)
229
229
  return r
230
230
 
231
+ def sync_revoke_chat_invite_link(
232
+ self,
233
+ chat_id: int,
234
+ invite_link: str,
235
+ ):
236
+ url = self.tg_base_url + "revokeChatInviteLink"
237
+ data = {"chat_id": chat_id, "invite_link": invite_link}
238
+ r = self._perform_sync_request(url, data)
239
+ return r
240
+
241
+ async def async_revoke_chat_invite_link(
242
+ self,
243
+ chat_id: int,
244
+ invite_link: str,
245
+ ):
246
+ url = self.tg_base_url + "revokeChatInviteLink"
247
+ data = {"chat_id": chat_id, "invite_link": invite_link}
248
+ r = await self._perform_async_request(url, data)
249
+ return r
250
+
231
251
  def sync_approve_chat_join_request(
232
252
  self,
233
253
  chat_id: int,
@@ -258,6 +278,86 @@ class TelegramHelper(BaseHelper):
258
278
  r = self._perform_sync_request(url, data)
259
279
  return r
260
280
 
281
+ async def async_unban_chat_member(
282
+ self,
283
+ chat_id: int,
284
+ user_id: int,
285
+ ):
286
+ url = self.tg_base_url + "unbanChatMember"
287
+ data = {"chat_id": chat_id, "user_id": user_id}
288
+ r = await self._perform_async_request(url, data)
289
+ return r
290
+
291
+ def sync_unban_chat_member(
292
+ self,
293
+ chat_id: int,
294
+ user_id: int,
295
+ ):
296
+ url = self.tg_base_url + "unbanChatMember"
297
+ data = {"chat_id": chat_id, "user_id": user_id}
298
+ r = self._perform_sync_request(url, data)
299
+ return r
300
+
301
+ async def async_get_chat_member(
302
+ self,
303
+ chat_id: int,
304
+ user_id: int,
305
+ ):
306
+ url = self.tg_base_url + "getChatMember"
307
+ data = {"chat_id": chat_id, "user_id": user_id}
308
+ r = await self._perform_async_request(url, data)
309
+ return r
310
+
311
+ def sync_get_chat_member(
312
+ self,
313
+ chat_id: int,
314
+ user_id: int,
315
+ ):
316
+ url = self.tg_base_url + "getChatMember"
317
+ data = {"chat_id": chat_id, "user_id": user_id}
318
+ r = self._perform_sync_request(url, data)
319
+ return r
320
+
321
+ async def async_set_chat_title(
322
+ self,
323
+ chat_id: int,
324
+ title: str,
325
+ ):
326
+ url = self.tg_base_url + "setChatTitle"
327
+ data = {"chat_id": chat_id, "title": title}
328
+ r = await self._perform_async_request(url, data)
329
+ return r
330
+
331
+ def sync_set_chat_title(
332
+ self,
333
+ chat_id: int,
334
+ title: str,
335
+ ):
336
+ url = self.tg_base_url + "setChatTitle"
337
+ data = {"chat_id": chat_id, "title": title}
338
+ r = self._perform_sync_request(url, data)
339
+ return r
340
+
341
+ async def async_set_chat_description(
342
+ self,
343
+ chat_id: int,
344
+ description: str,
345
+ ):
346
+ url = self.tg_base_url + "setChatDescription"
347
+ data = {"chat_id": chat_id, "description": description}
348
+ r = await self._perform_async_request(url, data)
349
+ return r
350
+
351
+ def sync_set_chat_description(
352
+ self,
353
+ chat_id: int,
354
+ description: str,
355
+ ):
356
+ url = self.tg_base_url + "setChatDescription"
357
+ data = {"chat_id": chat_id, "description": description}
358
+ r = self._perform_sync_request(url, data)
359
+ return r
360
+
261
361
  async def async_decline_chat_join_request(
262
362
  self,
263
363
  chat_id: int,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: multibotkit
3
- Version: 0.1.26
3
+ Version: 0.1.28
4
4
  Summary: Functional library for developing multiplatform chatbots
5
5
  Home-page: https://github.com/Appvelox/multibotkit
6
6
  Author: Appvelox LLC
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="multibotkit",
8
- version="0.1.26",
8
+ version="0.1.28",
9
9
  author="Appvelox LLC",
10
10
  author_email="team@appvelox.ru",
11
11
  description="Functional library for developing multiplatform chatbots",
File without changes
File without changes
File without changes