multibotkit 0.1.14__py3-none-any.whl → 0.1.16__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.
@@ -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,
@@ -224,6 +224,18 @@ class User(BaseModel):
224
224
  )
225
225
 
226
226
 
227
+ class WebAppData(BaseModel):
228
+ data: str = Field(
229
+ ...,
230
+ title="The data. Be aware that a bad client can send arbitrary data in this field.",
231
+ )
232
+ button_text: str = Field(
233
+ ...,
234
+ title="Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can "
235
+ "send arbitrary data in this field.",
236
+ )
237
+
238
+
227
239
  class Message(BaseModel):
228
240
  message_id: int = Field(..., title="Unique message identifier inside this chat")
229
241
  date: int = Field(..., title="Date the message was sent in Unix time")
@@ -268,6 +280,9 @@ video message",
268
280
  title="Message is a shared location, information about \
269
281
  the location",
270
282
  )
283
+ web_app_data: Optional[WebAppData] = Field(
284
+ None, title="Service message: data sent by a Web App"
285
+ )
271
286
 
272
287
  class Config:
273
288
  fields = {"from_": "from"}
@@ -84,6 +84,12 @@ Array of InlineKeyboardButton objects",
84
84
  )
85
85
 
86
86
 
87
+ class WebAppInfo(BaseModel):
88
+ url: str = Field(
89
+ ..., title="HTTP url of WebApp to be started when button is pressed"
90
+ )
91
+
92
+
87
93
  class KeyboardButton(BaseModel):
88
94
  text: str = Field(..., title="Text of the button")
89
95
  request_contact: Optional[bool] = Field(
@@ -96,6 +102,9 @@ contact when the button is pressed",
96
102
  title="If True, the user's current location will be sent \
97
103
  when the button is pressed",
98
104
  )
105
+ web_app: Optional[WebAppInfo] = Field(
106
+ None, title="Info about WebApp to be started when button is pressed"
107
+ )
99
108
 
100
109
 
101
110
  class ReplyKeyboardMarkup(BaseModel):
@@ -124,6 +133,15 @@ class ReplyKeyboardRemove(BaseModel):
124
133
  remove_keyboard: bool = Field(True, title="Remove reply keyboard")
125
134
 
126
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
+
127
145
  class Message(BaseModel):
128
146
  chat_id: int = Field(..., title="Unique identifier for the chat")
129
147
  text: str = Field(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: multibotkit
3
- Version: 0.1.14
3
+ Version: 0.1.16
4
4
  Summary: Functional library for developing multiplatform chatbots
5
5
  Home-page: https://github.com/Appvelox/multibotkit
6
6
  Author: Appvelox LLC
@@ -8,7 +8,7 @@ multibotkit/dispatchers/vk.py,sha256=EsFOL2g3ju-nhsdyRY4JBTJxqQPmaPAB7Mkn462s4tk
8
8
  multibotkit/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  multibotkit/helpers/base_helper.py,sha256=b4vlmwELwGUIJE0DvD2Lkk0LO-b-w0VWAnEnnYawOKQ,1462
10
10
  multibotkit/helpers/fb.py,sha256=Z2Vo6A_fepVBQNcWCeelmH72zf_eKyXOXheUIlaIiBI,4329
11
- multibotkit/helpers/telegram.py,sha256=8VnLF5AAkt0_rawdNnjMetF2wHME918V_TTQLcbOMvo,50855
11
+ multibotkit/helpers/telegram.py,sha256=hghsllqnj3cg1jbRZUWnefxf4uwnN_aL5bOBJrdoP3Q,52059
12
12
  multibotkit/helpers/viber.py,sha256=74UQ3RtHS3iR8qA5XVeMOYfXaaMq2pF0cpItwehdr4o,9246
13
13
  multibotkit/helpers/vk.py,sha256=QlI9rGEjhzqS-jcFrnZJ651lDbC4m33SSHAC1zWDyUU,5930
14
14
  multibotkit/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -16,8 +16,8 @@ multibotkit/schemas/fb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
16
16
  multibotkit/schemas/fb/incoming.py,sha256=sp4CeQohaDMOxz113dNxJDv_fSaGW5i8qzVS7FKdvcU,3158
17
17
  multibotkit/schemas/fb/outgoing.py,sha256=Qm0gPHHipAolXpnOJC4J4bfYjQEWpX54vYygSwKtIV4,8036
18
18
  multibotkit/schemas/telegram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
- multibotkit/schemas/telegram/incoming.py,sha256=mLZ55IHvalbI_CpSv1QhtsWEBjPKYAH9FP2uYWfDSqE,10379
20
- multibotkit/schemas/telegram/outgoing.py,sha256=fepZWcSeTmllMUjoTYcAeQgmxtCkW0tD2mO2rHmGBNU,10888
19
+ multibotkit/schemas/telegram/incoming.py,sha256=ba67RQT5phOEIWTMG72SomUQrdxiuoKlXOxiz5fiaeA,10881
20
+ multibotkit/schemas/telegram/outgoing.py,sha256=hCQP7UKRfSh-hX6F5KDfZwxWItBkOWCo5zHRVtIYECk,11569
21
21
  multibotkit/schemas/viber/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  multibotkit/schemas/viber/incoming.py,sha256=0sS9g-NmQFl_uoVz8pkbQ9zdNsXvGE52KxmzADoFIRM,4193
23
23
  multibotkit/schemas/viber/outgoing.py,sha256=KI73IX-aawtAx3ejW2Hx0ivXBYuMVudUxhwyp1wv6rc,8252
@@ -31,8 +31,8 @@ multibotkit/states/managers/base.py,sha256=KOO-wtbj984-lLq6u6LhxR79NTftQV2c5uUG6
31
31
  multibotkit/states/managers/memory.py,sha256=uN064uj2Q0ivK9LGEHJFaaaG6FEyXkIajS87TCAuYsI,1328
32
32
  multibotkit/states/managers/mongo.py,sha256=K8upbLT0892YA2Qi9dDPXDP5jvQoS16T8FW-qapv1Xk,1927
33
33
  multibotkit/states/managers/redis.py,sha256=C9HTjfVvttzOizycprWHd2C86DfKqd2Nyq5-5CqQNDI,1659
34
- multibotkit-0.1.14.dist-info/LICENSE,sha256=3iCLdX93Z5F6PpDqN6q7wufsBixXuTAYwgzntBQjYBQ,1069
35
- multibotkit-0.1.14.dist-info/METADATA,sha256=1CUik_t4gRkHO9jgYvqpealRsIHX5U48cLzIuJYHzpQ,837
36
- multibotkit-0.1.14.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
37
- multibotkit-0.1.14.dist-info/top_level.txt,sha256=Meo5tTNdc5pf6_qwW6x4Cqz5iJJlXFqUDMti96pzV2I,12
38
- multibotkit-0.1.14.dist-info/RECORD,,
34
+ multibotkit-0.1.16.dist-info/LICENSE,sha256=3iCLdX93Z5F6PpDqN6q7wufsBixXuTAYwgzntBQjYBQ,1069
35
+ multibotkit-0.1.16.dist-info/METADATA,sha256=FTmehEFIiy7O3uD7dmN2anZhiqJ8NqduiW1qJfk2X6w,837
36
+ multibotkit-0.1.16.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
37
+ multibotkit-0.1.16.dist-info/top_level.txt,sha256=Meo5tTNdc5pf6_qwW6x4Cqz5iJJlXFqUDMti96pzV2I,12
38
+ multibotkit-0.1.16.dist-info/RECORD,,