multibotkit 0.1.31__tar.gz → 0.1.32__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.
- {multibotkit-0.1.31 → multibotkit-0.1.32}/PKG-INFO +1 -1
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/helpers/telegram.py +38 -2
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/schemas/telegram/outgoing.py +19 -2
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit.egg-info/PKG-INFO +1 -1
- {multibotkit-0.1.31 → multibotkit-0.1.32}/setup.py +1 -1
- {multibotkit-0.1.31 → multibotkit-0.1.32}/LICENSE +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/README.md +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/__init__.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/dispatchers/__init__.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/dispatchers/base_dispatcher.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/dispatchers/fb.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/dispatchers/telegram.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/dispatchers/viber.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/dispatchers/vk.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/helpers/__init__.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/helpers/base_helper.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/helpers/fb.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/helpers/viber.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/helpers/vk.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/schemas/__init__.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/schemas/fb/__init__.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/schemas/fb/incoming.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/schemas/fb/outgoing.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/schemas/telegram/__init__.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/schemas/telegram/incoming.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/schemas/viber/__init__.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/schemas/viber/incoming.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/schemas/viber/outgoing.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/schemas/vk/__init__.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/schemas/vk/incoming.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/schemas/vk/outgoing.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/states/__init__.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/states/managers/__init__.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/states/managers/base.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/states/managers/memory.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/states/managers/mongo.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/states/managers/redis.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit/states/state.py +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit.egg-info/SOURCES.txt +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit.egg-info/dependency_links.txt +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit.egg-info/requires.txt +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/multibotkit.egg-info/top_level.txt +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/pyproject.toml +0 -0
- {multibotkit-0.1.31 → multibotkit-0.1.32}/setup.cfg +0 -0
|
@@ -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
|
|
|
@@ -1812,3 +1812,39 @@ class TelegramHelper(BaseHelper):
|
|
|
1812
1812
|
data = {"name": sticker_set}
|
|
1813
1813
|
r = await self._perform_async_request(url, data)
|
|
1814
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
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|