multibotkit 0.1.30__py3-none-any.whl → 0.1.32__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 +56 -2
- multibotkit/schemas/telegram/outgoing.py +19 -2
- {multibotkit-0.1.30.dist-info → multibotkit-0.1.32.dist-info}/METADATA +1 -1
- {multibotkit-0.1.30.dist-info → multibotkit-0.1.32.dist-info}/RECORD +7 -7
- {multibotkit-0.1.30.dist-info → multibotkit-0.1.32.dist-info}/LICENSE +0 -0
- {multibotkit-0.1.30.dist-info → multibotkit-0.1.32.dist-info}/WHEEL +0 -0
- {multibotkit-0.1.30.dist-info → multibotkit-0.1.32.dist-info}/top_level.txt +0 -0
multibotkit/helpers/telegram.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from io import BytesIO
|
|
2
2
|
import json
|
|
3
|
-
from typing import IO, Optional, Union, List
|
|
3
|
+
from typing import IO, Optional, Union, List, Tuple
|
|
4
4
|
|
|
5
5
|
import aiofiles
|
|
6
6
|
import httpx
|
|
@@ -31,7 +31,7 @@ from multibotkit.schemas.telegram.outgoing import (
|
|
|
31
31
|
Location,
|
|
32
32
|
DeleteWebhookParams,
|
|
33
33
|
DeleteMessage,
|
|
34
|
-
CopyMessage,
|
|
34
|
+
CopyMessage, BotCommand, SetMyCommands,
|
|
35
35
|
)
|
|
36
36
|
|
|
37
37
|
|
|
@@ -476,6 +476,24 @@ class TelegramHelper(BaseHelper):
|
|
|
476
476
|
r = self._perform_sync_request(url, data)
|
|
477
477
|
return r
|
|
478
478
|
|
|
479
|
+
async def async_get_chat_administrators(
|
|
480
|
+
self,
|
|
481
|
+
chat_id: int,
|
|
482
|
+
):
|
|
483
|
+
url = self.tg_base_url + "getChatAdministrators"
|
|
484
|
+
data = {"chat_id": chat_id}
|
|
485
|
+
r = await self._perform_async_request(url, data)
|
|
486
|
+
return r
|
|
487
|
+
|
|
488
|
+
def sync_get_chat_administrators(
|
|
489
|
+
self,
|
|
490
|
+
chat_id: int,
|
|
491
|
+
):
|
|
492
|
+
url = self.tg_base_url + "getChatAdministrators"
|
|
493
|
+
data = {"chat_id": chat_id}
|
|
494
|
+
r = self._perform_sync_request(url, data)
|
|
495
|
+
return r
|
|
496
|
+
|
|
479
497
|
def sync_decline_chat_join_request(
|
|
480
498
|
self,
|
|
481
499
|
chat_id: int,
|
|
@@ -1794,3 +1812,39 @@ class TelegramHelper(BaseHelper):
|
|
|
1794
1812
|
data = {"name": sticker_set}
|
|
1795
1813
|
r = await self._perform_async_request(url, data)
|
|
1796
1814
|
return r
|
|
1815
|
+
|
|
1816
|
+
def sync_set_my_commands(
|
|
1817
|
+
self,
|
|
1818
|
+
commands: List[Tuple[str, str]]
|
|
1819
|
+
):
|
|
1820
|
+
url = self.tg_base_url + "setMyCommands"
|
|
1821
|
+
commands_list = []
|
|
1822
|
+
for command, description in commands:
|
|
1823
|
+
commands_list.append(
|
|
1824
|
+
BotCommand(command=command, description=description)
|
|
1825
|
+
)
|
|
1826
|
+
|
|
1827
|
+
set_my_commands = SetMyCommands(
|
|
1828
|
+
commands=commands_list
|
|
1829
|
+
)
|
|
1830
|
+
|
|
1831
|
+
r = self._perform_sync_request(url, set_my_commands.dict())
|
|
1832
|
+
return r
|
|
1833
|
+
|
|
1834
|
+
async def async_set_my_commands(
|
|
1835
|
+
self,
|
|
1836
|
+
commands: List[Tuple[str, str]]
|
|
1837
|
+
):
|
|
1838
|
+
url = self.tg_base_url + "setMyCommands"
|
|
1839
|
+
commands_list = []
|
|
1840
|
+
for command, description in commands:
|
|
1841
|
+
commands_list.append(
|
|
1842
|
+
BotCommand(command=command, description=description)
|
|
1843
|
+
)
|
|
1844
|
+
|
|
1845
|
+
set_my_commands = SetMyCommands(
|
|
1846
|
+
commands=commands_list
|
|
1847
|
+
)
|
|
1848
|
+
|
|
1849
|
+
r = await self._perform_async_request(url, set_my_commands.dict())
|
|
1850
|
+
return r
|
|
@@ -51,12 +51,12 @@ class CopyMessage(BaseModel):
|
|
|
51
51
|
chat_id: int = Field(
|
|
52
52
|
...,
|
|
53
53
|
title="Unique identifier for the target chat or username of the target channel "
|
|
54
|
-
|
|
54
|
+
"(in the format @channelusername)",
|
|
55
55
|
)
|
|
56
56
|
from_chat_id: int = Field(
|
|
57
57
|
...,
|
|
58
58
|
title="Unique identifier for the chat where the original message was sent (or channel username in "
|
|
59
|
-
|
|
59
|
+
"the format @channelusername)",
|
|
60
60
|
)
|
|
61
61
|
message_id: int = Field(
|
|
62
62
|
..., title="Message identifier in the chat specified in from_chat_id"
|
|
@@ -328,3 +328,20 @@ class Sticker(BaseModel):
|
|
|
328
328
|
reply_markup: Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup]] = Field(
|
|
329
329
|
None, title="reply markup"
|
|
330
330
|
)
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
class BotCommand(BaseModel):
|
|
334
|
+
command: str = Field(
|
|
335
|
+
...,
|
|
336
|
+
title="Text of the command; 1-32 characters. "
|
|
337
|
+
"Can contain only lowercase English letters, digits and underscores.",
|
|
338
|
+
)
|
|
339
|
+
description: str = Field(..., title="Description of the command; 1-256 characters.")
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
class SetMyCommands(BaseModel):
|
|
343
|
+
commands: List[BotCommand] = Field(
|
|
344
|
+
...,
|
|
345
|
+
title="A JSON-serialized list of bot commands to be set as the list of the bot's commands. "
|
|
346
|
+
"At most 100 commands can be specified.",
|
|
347
|
+
)
|
|
@@ -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=hxyx-DzqgdZcTC_AO5l9D8ZOsmk0ore0F_YnZtrheTs,67310
|
|
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=gD5i5NdIwTDLXEYBMNBCNCthNOKnFXghRTd81SKuPb4,15345
|
|
20
|
-
multibotkit/schemas/telegram/outgoing.py,sha256=
|
|
20
|
+
multibotkit/schemas/telegram/outgoing.py,sha256=YeAvTkmBYJrRK46pZwYdF74SlyRqJgKDxU-WKnewYCE,13194
|
|
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=XMpQ8LUdO9mZq3cZXlYOcGCC0VsSbsxBsEzVFH7TeEM,1681
|
|
34
|
-
multibotkit-0.1.
|
|
35
|
-
multibotkit-0.1.
|
|
36
|
-
multibotkit-0.1.
|
|
37
|
-
multibotkit-0.1.
|
|
38
|
-
multibotkit-0.1.
|
|
34
|
+
multibotkit-0.1.32.dist-info/LICENSE,sha256=3iCLdX93Z5F6PpDqN6q7wufsBixXuTAYwgzntBQjYBQ,1069
|
|
35
|
+
multibotkit-0.1.32.dist-info/METADATA,sha256=aZue0F4eDs3sWysDn-hYElzn9D4s9rC1Y5km0ZoxFbI,826
|
|
36
|
+
multibotkit-0.1.32.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
37
|
+
multibotkit-0.1.32.dist-info/top_level.txt,sha256=Meo5tTNdc5pf6_qwW6x4Cqz5iJJlXFqUDMti96pzV2I,12
|
|
38
|
+
multibotkit-0.1.32.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|