multibotkit 0.1.15__tar.gz → 0.1.17__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.15 → multibotkit-0.1.17}/PKG-INFO +1 -1
  2. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/helpers/telegram.py +61 -3
  3. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/schemas/telegram/outgoing.py +9 -0
  4. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit.egg-info/PKG-INFO +1 -1
  5. {multibotkit-0.1.15 → multibotkit-0.1.17}/setup.py +1 -1
  6. {multibotkit-0.1.15 → multibotkit-0.1.17}/LICENSE +0 -0
  7. {multibotkit-0.1.15 → multibotkit-0.1.17}/README.md +0 -0
  8. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/__init__.py +0 -0
  9. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/dispatchers/__init__.py +0 -0
  10. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/dispatchers/base_dispatcher.py +0 -0
  11. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/dispatchers/fb.py +0 -0
  12. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/dispatchers/telegram.py +0 -0
  13. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/dispatchers/viber.py +0 -0
  14. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/dispatchers/vk.py +0 -0
  15. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/helpers/__init__.py +0 -0
  16. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/helpers/base_helper.py +0 -0
  17. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/helpers/fb.py +0 -0
  18. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/helpers/viber.py +0 -0
  19. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/helpers/vk.py +0 -0
  20. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/schemas/__init__.py +0 -0
  21. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/schemas/fb/__init__.py +0 -0
  22. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/schemas/fb/incoming.py +0 -0
  23. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/schemas/fb/outgoing.py +0 -0
  24. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/schemas/telegram/__init__.py +0 -0
  25. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/schemas/telegram/incoming.py +0 -0
  26. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/schemas/viber/__init__.py +0 -0
  27. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/schemas/viber/incoming.py +0 -0
  28. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/schemas/viber/outgoing.py +0 -0
  29. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/schemas/vk/__init__.py +0 -0
  30. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/schemas/vk/incoming.py +0 -0
  31. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/schemas/vk/outgoing.py +0 -0
  32. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/states/__init__.py +0 -0
  33. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/states/managers/__init__.py +0 -0
  34. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/states/managers/base.py +0 -0
  35. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/states/managers/memory.py +0 -0
  36. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/states/managers/mongo.py +0 -0
  37. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/states/managers/redis.py +0 -0
  38. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit/states/state.py +0 -0
  39. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit.egg-info/SOURCES.txt +0 -0
  40. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit.egg-info/dependency_links.txt +0 -0
  41. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit.egg-info/requires.txt +0 -0
  42. {multibotkit-0.1.15 → multibotkit-0.1.17}/multibotkit.egg-info/top_level.txt +0 -0
  43. {multibotkit-0.1.15 → multibotkit-0.1.17}/pyproject.toml +0 -0
  44. {multibotkit-0.1.15 → multibotkit-0.1.17}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: multibotkit
3
- Version: 0.1.15
3
+ Version: 0.1.17
4
4
  Summary: Functional library for developing multiplatform chatbots
5
5
  Home-page: https://github.com/Appvelox/multibotkit
6
6
  Author: Appvelox LLC
@@ -26,7 +26,9 @@ from multibotkit.schemas.telegram.outgoing import (
26
26
  WebhookInfo,
27
27
  MediaGroup,
28
28
  ReplyKeyboardRemove,
29
- Sticker, Video,
29
+ Sticker,
30
+ Video,
31
+ Location,
30
32
  )
31
33
 
32
34
 
@@ -67,6 +69,46 @@ class TelegramHelper(BaseHelper):
67
69
  r = await self._perform_async_request(url, data)
68
70
  return r
69
71
 
72
+ def sync_send_locations(
73
+ self,
74
+ chat_id: int,
75
+ latitude: float,
76
+ longitude: float,
77
+ reply_markup: Optional[
78
+ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove]
79
+ ] = None,
80
+ ):
81
+ url = self.tg_base_url + "sendLocation"
82
+ params = Location(
83
+ chat_id=chat_id,
84
+ latitude=latitude,
85
+ longitude=longitude,
86
+ reply_markup=reply_markup,
87
+ )
88
+ data = params.dict(exclude_none=True)
89
+ r = self._perform_sync_request(url, data)
90
+ return r
91
+
92
+ async def async_send_locations(
93
+ self,
94
+ chat_id: int,
95
+ latitude: float,
96
+ longitude: float,
97
+ reply_markup: Optional[
98
+ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove]
99
+ ] = None,
100
+ ):
101
+ url = self.tg_base_url + "sendLocation"
102
+ params = Location(
103
+ chat_id=chat_id,
104
+ latitude=latitude,
105
+ longitude=longitude,
106
+ reply_markup=reply_markup,
107
+ )
108
+ data = params.dict(exclude_none=True)
109
+ r = await self._perform_async_request(url, data)
110
+ return r
111
+
70
112
  def sync_send_message(
71
113
  self,
72
114
  chat_id: int,
@@ -121,15 +163,31 @@ class TelegramHelper(BaseHelper):
121
163
  r = await self._perform_async_request(url, data)
122
164
  return r
123
165
 
124
- def sync_answer_callback_query(self, callback_query_id: str):
166
+ def sync_answer_callback_query(
167
+ self,
168
+ callback_query_id: str,
169
+ text: Optional[str] = None,
170
+ show_alert: Optional[bool] = False,
171
+ ):
125
172
  url = self.tg_base_url + "answerCallbackQuery"
126
173
  data = {"callback_query_id": callback_query_id}
174
+ if show_alert and text is not None:
175
+ data["show_alert"] = show_alert
176
+ data["text"] = text
127
177
  r = self._perform_sync_request(url, data)
128
178
  return r
129
179
 
130
- async def async_answer_callback_query(self, callback_query_id: str):
180
+ async def async_answer_callback_query(
181
+ self,
182
+ callback_query_id: str,
183
+ text: Optional[str] = None,
184
+ show_alert: Optional[bool] = False,
185
+ ):
131
186
  url = self.tg_base_url + "answerCallbackQuery"
132
187
  data = {"callback_query_id": callback_query_id}
188
+ if show_alert and text is not None:
189
+ data["show_alert"] = show_alert
190
+ data["text"] = text
133
191
  r = await self._perform_async_request(url, data)
134
192
  return r
135
193
 
@@ -133,6 +133,15 @@ class ReplyKeyboardRemove(BaseModel):
133
133
  remove_keyboard: bool = Field(True, title="Remove reply keyboard")
134
134
 
135
135
 
136
+ class Location(BaseModel):
137
+ chat_id: int = Field(..., title="Unique identifier for the chat")
138
+ latitude: float = Field(..., title="Latitude of the location")
139
+ longitude: float = Field(..., title="Longitude of the location")
140
+ reply_markup: Optional[
141
+ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove]
142
+ ] = Field(None, title="Inline or Reply keyboard attached to the message")
143
+
144
+
136
145
  class Message(BaseModel):
137
146
  chat_id: int = Field(..., title="Unique identifier for the chat")
138
147
  text: str = Field(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: multibotkit
3
- Version: 0.1.15
3
+ Version: 0.1.17
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.15",
8
+ version="0.1.17",
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