multibotkit 0.1.8__py3-none-any.whl → 0.1.9__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.
- multibotkit/helpers/telegram.py +75 -0
- multibotkit/schemas/telegram/outgoing.py +10 -0
- {multibotkit-0.1.8.dist-info → multibotkit-0.1.9.dist-info}/METADATA +1 -1
- {multibotkit-0.1.8.dist-info → multibotkit-0.1.9.dist-info}/RECORD +7 -7
- {multibotkit-0.1.8.dist-info → multibotkit-0.1.9.dist-info}/LICENSE +0 -0
- {multibotkit-0.1.8.dist-info → multibotkit-0.1.9.dist-info}/WHEEL +0 -0
- {multibotkit-0.1.8.dist-info → multibotkit-0.1.9.dist-info}/top_level.txt +0 -0
multibotkit/helpers/telegram.py
CHANGED
|
@@ -25,6 +25,7 @@ from multibotkit.schemas.telegram.outgoing import (
|
|
|
25
25
|
SetWebhookParams,
|
|
26
26
|
WebhookInfo,
|
|
27
27
|
MediaGroup, ReplyKeyboardRemove,
|
|
28
|
+
Sticker
|
|
28
29
|
)
|
|
29
30
|
|
|
30
31
|
|
|
@@ -1075,3 +1076,77 @@ class TelegramHelper(BaseHelper):
|
|
|
1075
1076
|
|
|
1076
1077
|
r = await self._perform_async_request(url, data)
|
|
1077
1078
|
return r
|
|
1079
|
+
|
|
1080
|
+
async def async_send_sticker(
|
|
1081
|
+
self,
|
|
1082
|
+
chat_id: int,
|
|
1083
|
+
sticker: str,
|
|
1084
|
+
disable_notification: Optional[bool] = None,
|
|
1085
|
+
protect_content: Optional[bool] = None,
|
|
1086
|
+
reply_to_message_id: Optional[int] = None,
|
|
1087
|
+
allow_sending_without_reply: Optional[bool] = None,
|
|
1088
|
+
reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup]] = None
|
|
1089
|
+
):
|
|
1090
|
+
sticker_obj = Sticker(
|
|
1091
|
+
chat_id=chat_id,
|
|
1092
|
+
sticker=sticker,
|
|
1093
|
+
disable_notification=disable_notification,
|
|
1094
|
+
protect_content=protect_content,
|
|
1095
|
+
reply_to_message_id=reply_to_message_id,
|
|
1096
|
+
allow_sending_without_reply=allow_sending_without_reply,
|
|
1097
|
+
reply_markup=reply_markup
|
|
1098
|
+
)
|
|
1099
|
+
|
|
1100
|
+
url = self.tg_base_url + "sendSticker"
|
|
1101
|
+
data = sticker_obj.dict(exclude_none=True)
|
|
1102
|
+
if "reply_markup" in data.keys():
|
|
1103
|
+
data["reply_markup"] = json.dumps(data["reply_markup"])
|
|
1104
|
+
|
|
1105
|
+
r = await self._perform_async_request(url, data)
|
|
1106
|
+
return r
|
|
1107
|
+
|
|
1108
|
+
def sync_send_sticker(
|
|
1109
|
+
self,
|
|
1110
|
+
chat_id: int,
|
|
1111
|
+
sticker: str,
|
|
1112
|
+
disable_notification: Optional[bool] = None,
|
|
1113
|
+
protect_content: Optional[bool] = None,
|
|
1114
|
+
reply_to_message_id: Optional[int] = None,
|
|
1115
|
+
allow_sending_without_reply: Optional[bool] = None,
|
|
1116
|
+
reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup]] = None
|
|
1117
|
+
):
|
|
1118
|
+
sticker_obj = Sticker(
|
|
1119
|
+
chat_id=chat_id,
|
|
1120
|
+
sticker=sticker,
|
|
1121
|
+
disable_notification=disable_notification,
|
|
1122
|
+
protect_content=protect_content,
|
|
1123
|
+
reply_to_message_id=reply_to_message_id,
|
|
1124
|
+
allow_sending_without_reply=allow_sending_without_reply,
|
|
1125
|
+
reply_markup=reply_markup
|
|
1126
|
+
)
|
|
1127
|
+
|
|
1128
|
+
url = self.tg_base_url + "sendSticker"
|
|
1129
|
+
data = sticker_obj.dict(exclude_none=True)
|
|
1130
|
+
if "reply_markup" in data.keys():
|
|
1131
|
+
data["reply_markup"] = json.dumps(data["reply_markup"])
|
|
1132
|
+
|
|
1133
|
+
r = self._perform_sync_request(url, data)
|
|
1134
|
+
return r
|
|
1135
|
+
|
|
1136
|
+
def sync_get_sticker_set(
|
|
1137
|
+
self,
|
|
1138
|
+
sticker_set: str,
|
|
1139
|
+
):
|
|
1140
|
+
url = self.tg_base_url + "getStickerSet"
|
|
1141
|
+
data = {"name": sticker_set}
|
|
1142
|
+
r = self._perform_sync_request(url, data)
|
|
1143
|
+
return r
|
|
1144
|
+
|
|
1145
|
+
async def async_get_sticker_set(
|
|
1146
|
+
self,
|
|
1147
|
+
sticker_set: str,
|
|
1148
|
+
):
|
|
1149
|
+
url = self.tg_base_url + "getStickerSet"
|
|
1150
|
+
data = {"name": sticker_set}
|
|
1151
|
+
r = await self._perform_async_request(url, data)
|
|
1152
|
+
return r
|
|
@@ -218,3 +218,13 @@ class Audio(BaseModel):
|
|
|
218
218
|
reply_to_message_id: Optional[int] = Field(None, title="reply to message id")
|
|
219
219
|
allow_sending_without_reply: Optional[bool] = Field(None, title="allow sending without reply")
|
|
220
220
|
reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup]] = Field(None, title="reply markup")
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
class Sticker(BaseModel):
|
|
224
|
+
chat_id: int = Field(..., title="chat id")
|
|
225
|
+
sticker: str = Field(..., title="document")
|
|
226
|
+
disable_notification: Optional[bool] = Field(None, title="disable notification")
|
|
227
|
+
protect_content: Optional[bool] = Field(None, title="protect content")
|
|
228
|
+
reply_to_message_id: Optional[int] = Field(None, title="reply to message id")
|
|
229
|
+
allow_sending_without_reply: Optional[bool] = Field(None, title="allow sending without reply")
|
|
230
|
+
reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup]] = Field(None, title="reply markup")
|
|
@@ -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=
|
|
11
|
+
multibotkit/helpers/telegram.py,sha256=7zJnJ5IHykuA_DaAGAV75z35t36D7rMJGvoxrOCZy8I,42592
|
|
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
|
|
@@ -17,7 +17,7 @@ multibotkit/schemas/fb/incoming.py,sha256=sp4CeQohaDMOxz113dNxJDv_fSaGW5i8qzVS7F
|
|
|
17
17
|
multibotkit/schemas/fb/outgoing.py,sha256=Qm0gPHHipAolXpnOJC4J4bfYjQEWpX54vYygSwKtIV4,8036
|
|
18
18
|
multibotkit/schemas/telegram/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
multibotkit/schemas/telegram/incoming.py,sha256=mLZ55IHvalbI_CpSv1QhtsWEBjPKYAH9FP2uYWfDSqE,10379
|
|
20
|
-
multibotkit/schemas/telegram/outgoing.py,sha256=
|
|
20
|
+
multibotkit/schemas/telegram/outgoing.py,sha256=Iv1KCwR_28ugd1GkKrJHgPVP2zblKFYwh03hmajg1Is,9492
|
|
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.
|
|
35
|
-
multibotkit-0.1.
|
|
36
|
-
multibotkit-0.1.
|
|
37
|
-
multibotkit-0.1.
|
|
38
|
-
multibotkit-0.1.
|
|
34
|
+
multibotkit-0.1.9.dist-info/LICENSE,sha256=3iCLdX93Z5F6PpDqN6q7wufsBixXuTAYwgzntBQjYBQ,1069
|
|
35
|
+
multibotkit-0.1.9.dist-info/METADATA,sha256=-xXxqZlO6VHBs1maQU3ase9ewh32mlK9JCEi19erzXM,851
|
|
36
|
+
multibotkit-0.1.9.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
37
|
+
multibotkit-0.1.9.dist-info/top_level.txt,sha256=Meo5tTNdc5pf6_qwW6x4Cqz5iJJlXFqUDMti96pzV2I,12
|
|
38
|
+
multibotkit-0.1.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|