multibotkit 0.1.19__tar.gz → 0.1.21__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.19 → multibotkit-0.1.21}/PKG-INFO +1 -1
  2. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/helpers/telegram.py +43 -3
  3. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/schemas/telegram/outgoing.py +16 -7
  4. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit.egg-info/PKG-INFO +1 -1
  5. {multibotkit-0.1.19 → multibotkit-0.1.21}/setup.py +1 -1
  6. {multibotkit-0.1.19 → multibotkit-0.1.21}/LICENSE +0 -0
  7. {multibotkit-0.1.19 → multibotkit-0.1.21}/README.md +0 -0
  8. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/__init__.py +0 -0
  9. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/dispatchers/__init__.py +0 -0
  10. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/dispatchers/base_dispatcher.py +0 -0
  11. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/dispatchers/fb.py +0 -0
  12. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/dispatchers/telegram.py +0 -0
  13. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/dispatchers/viber.py +0 -0
  14. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/dispatchers/vk.py +0 -0
  15. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/helpers/__init__.py +0 -0
  16. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/helpers/base_helper.py +0 -0
  17. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/helpers/fb.py +0 -0
  18. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/helpers/viber.py +0 -0
  19. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/helpers/vk.py +0 -0
  20. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/schemas/__init__.py +0 -0
  21. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/schemas/fb/__init__.py +0 -0
  22. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/schemas/fb/incoming.py +0 -0
  23. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/schemas/fb/outgoing.py +0 -0
  24. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/schemas/telegram/__init__.py +0 -0
  25. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/schemas/telegram/incoming.py +0 -0
  26. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/schemas/viber/__init__.py +0 -0
  27. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/schemas/viber/incoming.py +0 -0
  28. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/schemas/viber/outgoing.py +0 -0
  29. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/schemas/vk/__init__.py +0 -0
  30. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/schemas/vk/incoming.py +0 -0
  31. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/schemas/vk/outgoing.py +0 -0
  32. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/states/__init__.py +0 -0
  33. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/states/managers/__init__.py +0 -0
  34. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/states/managers/base.py +0 -0
  35. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/states/managers/memory.py +0 -0
  36. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/states/managers/mongo.py +0 -0
  37. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/states/managers/redis.py +0 -0
  38. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit/states/state.py +0 -0
  39. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit.egg-info/SOURCES.txt +0 -0
  40. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit.egg-info/dependency_links.txt +0 -0
  41. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit.egg-info/requires.txt +0 -0
  42. {multibotkit-0.1.19 → multibotkit-0.1.21}/multibotkit.egg-info/top_level.txt +0 -0
  43. {multibotkit-0.1.19 → multibotkit-0.1.21}/pyproject.toml +0 -0
  44. {multibotkit-0.1.19 → multibotkit-0.1.21}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: multibotkit
3
- Version: 0.1.19
3
+ Version: 0.1.21
4
4
  Summary: Functional library for developing multiplatform chatbots
5
5
  Home-page: https://github.com/Appvelox/multibotkit
6
6
  Author: Appvelox LLC
@@ -28,7 +28,7 @@ from multibotkit.schemas.telegram.outgoing import (
28
28
  ReplyKeyboardRemove,
29
29
  Sticker,
30
30
  Video,
31
- Location, DeleteWebhookParams,
31
+ Location, DeleteWebhookParams, DeleteMessage,
32
32
  )
33
33
 
34
34
 
@@ -205,15 +205,55 @@ class TelegramHelper(BaseHelper):
205
205
  r = await self._perform_async_request(url, data)
206
206
  return r
207
207
 
208
- def sync_edit_message_text(self, chat_id: int, message_id: int, text: str):
208
+ def sync_delete_message(
209
+ self,
210
+ chat_id: int,
211
+ message_id: int,
212
+ ):
213
+ url = self.tg_base_url + "deleteMessage"
214
+ delete_message = DeleteMessage(chat_id=chat_id, message_id=message_id)
215
+
216
+ r = self._perform_sync_request(url, delete_message.dict())
217
+ return r
218
+
219
+ async def async_delete_message(
220
+ self,
221
+ chat_id: int,
222
+ message_id: int,
223
+ ):
224
+ url = self.tg_base_url + "deleteMessage"
225
+ delete_message = DeleteMessage(chat_id=chat_id, message_id=message_id)
226
+
227
+ r = await self._perform_async_request(url, delete_message.dict())
228
+ return r
229
+
230
+ def sync_edit_message_text(
231
+ self,
232
+ chat_id: int,
233
+ message_id: int,
234
+ text: str,
235
+ reply_markup: Optional[InlineKeyboardMarkup] = None,
236
+ ):
209
237
  url = self.tg_base_url + "editMessageText"
210
238
  data = {"chat_id": chat_id, "message_id": message_id, "text": text}
239
+ if reply_markup:
240
+ data["reply_markup"] = reply_markup.dict(exclude_none=True)
241
+
211
242
  r = self._perform_sync_request(url, data)
212
243
  return r
213
244
 
214
- async def async_edit_message_text(self, chat_id: int, message_id: int, text: str):
245
+ async def async_edit_message_text(
246
+ self,
247
+ chat_id: int,
248
+ message_id: int,
249
+ text: str,
250
+ reply_markup: Optional[InlineKeyboardMarkup] = None,
251
+ ):
215
252
  url = self.tg_base_url + "editMessageText"
216
253
  data = {"chat_id": chat_id, "message_id": message_id, "text": text}
254
+ if reply_markup:
255
+ data["reply_markup"] = reply_markup.dict(exclude_none=True)
256
+
217
257
  r = await self._perform_async_request(url, data)
218
258
  return r
219
259
 
@@ -33,7 +33,13 @@ updates may be received for a short period of time.",
33
33
 
34
34
 
35
35
  class DeleteWebhookParams(BaseModel):
36
- drop_pending_updates: Optional[bool] = Field(None, title="Pass True to drop all pending updates")
36
+ drop_pending_updates: int = Field(None, title="Unique identifier for the target chat or username of the"
37
+ " target channel (in the format @channelusername)")
38
+ message_id: int = Field(None, title="Identifier of the message to delete")
39
+
40
+
41
+ class DeleteMessage(BaseModel):
42
+ chat_id: Optional[bool] = Field(None, title="Pass True to drop all pending updates")
37
43
 
38
44
 
39
45
  class WebhookInfo(BaseModel):
@@ -68,6 +74,12 @@ to the webhook for update delivery",
68
74
  )
69
75
 
70
76
 
77
+ class WebAppInfo(BaseModel):
78
+ url: str = Field(
79
+ ..., title="HTTP url of WebApp to be started when button is pressed"
80
+ )
81
+
82
+
71
83
  class InlineKeyboardButton(BaseModel):
72
84
  text: str = Field(..., title="Label text on the button")
73
85
  url: Optional[str] = Field(
@@ -78,6 +90,9 @@ class InlineKeyboardButton(BaseModel):
78
90
  title=" Data to be sent in a callback query to the bot \
79
91
  when button is pressed, 1-64 bytes",
80
92
  )
93
+ web_app: Optional[WebAppInfo] = Field(
94
+ None, title="Info about WebApp to be started when button is pressed"
95
+ )
81
96
 
82
97
 
83
98
  class InlineKeyboardMarkup(BaseModel):
@@ -88,12 +103,6 @@ Array of InlineKeyboardButton objects",
88
103
  )
89
104
 
90
105
 
91
- class WebAppInfo(BaseModel):
92
- url: str = Field(
93
- ..., title="HTTP url of WebApp to be started when button is pressed"
94
- )
95
-
96
-
97
106
  class KeyboardButton(BaseModel):
98
107
  text: str = Field(..., title="Text of the button")
99
108
  request_contact: Optional[bool] = Field(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: multibotkit
3
- Version: 0.1.19
3
+ Version: 0.1.21
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.19",
8
+ version="0.1.21",
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