ng-bot-api 0.1.0__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.
- ng_bot_api/__init__.py +56 -0
- ng_bot_api/api_version.py +2 -0
- ng_bot_api/async_bot.py +97 -0
- ng_bot_api/core/__init__.py +31 -0
- ng_bot_api/core/base.py +36 -0
- ng_bot_api/core/caller.py +17 -0
- ng_bot_api/core/decoding.py +85 -0
- ng_bot_api/core/encoding.py +42 -0
- ng_bot_api/core/errors.py +75 -0
- ng_bot_api/core/input_file.py +56 -0
- ng_bot_api/core/polling.py +39 -0
- ng_bot_api/core/registry.py +72 -0
- ng_bot_api/core/request.py +67 -0
- ng_bot_api/core/typespec.py +57 -0
- ng_bot_api/dispatcher/__init__.py +17 -0
- ng_bot_api/dispatcher/dispatcher.py +95 -0
- ng_bot_api/dispatcher/filter_base.py +78 -0
- ng_bot_api/dispatcher/filters.py +124 -0
- ng_bot_api/dispatcher/handler.py +34 -0
- ng_bot_api/dispatcher/router.py +69 -0
- ng_bot_api/methods/__init__.py +115 -0
- ng_bot_api/methods/async_01.py +99 -0
- ng_bot_api/methods/async_02.py +114 -0
- ng_bot_api/methods/async_03.py +85 -0
- ng_bot_api/methods/async_04.py +110 -0
- ng_bot_api/methods/async_05.py +114 -0
- ng_bot_api/methods/async_06.py +74 -0
- ng_bot_api/methods/async_07.py +114 -0
- ng_bot_api/methods/async_08.py +106 -0
- ng_bot_api/methods/async_09.py +97 -0
- ng_bot_api/methods/async_10.py +92 -0
- ng_bot_api/methods/async_11.py +107 -0
- ng_bot_api/methods/async_12.py +119 -0
- ng_bot_api/methods/async_13.py +119 -0
- ng_bot_api/methods/async_14.py +113 -0
- ng_bot_api/methods/async_15.py +117 -0
- ng_bot_api/methods/async_16.py +115 -0
- ng_bot_api/methods/async_17.py +121 -0
- ng_bot_api/methods/async_18.py +118 -0
- ng_bot_api/methods/async_19.py +128 -0
- ng_bot_api/methods/async_20.py +115 -0
- ng_bot_api/methods/async_21.py +127 -0
- ng_bot_api/methods/async_22.py +110 -0
- ng_bot_api/methods/async_23.py +116 -0
- ng_bot_api/methods/async_24.py +118 -0
- ng_bot_api/methods/async_25.py +109 -0
- ng_bot_api/methods/async_26.py +124 -0
- ng_bot_api/methods/async_27.py +119 -0
- ng_bot_api/methods/async_28.py +119 -0
- ng_bot_api/methods/async_29.py +108 -0
- ng_bot_api/methods/async_30.py +115 -0
- ng_bot_api/methods/async_31.py +112 -0
- ng_bot_api/methods/async_32.py +126 -0
- ng_bot_api/methods/async_33.py +105 -0
- ng_bot_api/methods/async_34.py +117 -0
- ng_bot_api/methods/async_35.py +122 -0
- ng_bot_api/methods/async_36.py +121 -0
- ng_bot_api/methods/async_37.py +126 -0
- ng_bot_api/methods/async_38.py +112 -0
- ng_bot_api/methods/async_39.py +84 -0
- ng_bot_api/methods/async_40.py +125 -0
- ng_bot_api/methods/async_41.py +115 -0
- ng_bot_api/methods/async_42.py +30 -0
- ng_bot_api/methods/sync_01.py +99 -0
- ng_bot_api/methods/sync_02.py +114 -0
- ng_bot_api/methods/sync_03.py +85 -0
- ng_bot_api/methods/sync_04.py +110 -0
- ng_bot_api/methods/sync_05.py +114 -0
- ng_bot_api/methods/sync_06.py +74 -0
- ng_bot_api/methods/sync_07.py +114 -0
- ng_bot_api/methods/sync_08.py +106 -0
- ng_bot_api/methods/sync_09.py +97 -0
- ng_bot_api/methods/sync_10.py +92 -0
- ng_bot_api/methods/sync_11.py +107 -0
- ng_bot_api/methods/sync_12.py +119 -0
- ng_bot_api/methods/sync_13.py +119 -0
- ng_bot_api/methods/sync_14.py +113 -0
- ng_bot_api/methods/sync_15.py +117 -0
- ng_bot_api/methods/sync_16.py +115 -0
- ng_bot_api/methods/sync_17.py +121 -0
- ng_bot_api/methods/sync_18.py +118 -0
- ng_bot_api/methods/sync_19.py +128 -0
- ng_bot_api/methods/sync_20.py +115 -0
- ng_bot_api/methods/sync_21.py +127 -0
- ng_bot_api/methods/sync_22.py +110 -0
- ng_bot_api/methods/sync_23.py +116 -0
- ng_bot_api/methods/sync_24.py +118 -0
- ng_bot_api/methods/sync_25.py +109 -0
- ng_bot_api/methods/sync_26.py +124 -0
- ng_bot_api/methods/sync_27.py +119 -0
- ng_bot_api/methods/sync_28.py +119 -0
- ng_bot_api/methods/sync_29.py +108 -0
- ng_bot_api/methods/sync_30.py +115 -0
- ng_bot_api/methods/sync_31.py +112 -0
- ng_bot_api/methods/sync_32.py +126 -0
- ng_bot_api/methods/sync_33.py +105 -0
- ng_bot_api/methods/sync_34.py +117 -0
- ng_bot_api/methods/sync_35.py +122 -0
- ng_bot_api/methods/sync_36.py +121 -0
- ng_bot_api/methods/sync_37.py +126 -0
- ng_bot_api/methods/sync_38.py +112 -0
- ng_bot_api/methods/sync_39.py +84 -0
- ng_bot_api/methods/sync_40.py +125 -0
- ng_bot_api/methods/sync_41.py +115 -0
- ng_bot_api/methods/sync_42.py +30 -0
- ng_bot_api/py.typed +0 -0
- ng_bot_api/sync_bot.py +95 -0
- ng_bot_api/types/__init__.py +82 -0
- ng_bot_api/types/available_types_01.py +102 -0
- ng_bot_api/types/available_types_02.py +141 -0
- ng_bot_api/types/available_types_03.py +311 -0
- ng_bot_api/types/available_types_04.py +84 -0
- ng_bot_api/types/available_types_05.py +134 -0
- ng_bot_api/types/available_types_06.py +126 -0
- ng_bot_api/types/available_types_07.py +119 -0
- ng_bot_api/types/available_types_08.py +120 -0
- ng_bot_api/types/available_types_09.py +115 -0
- ng_bot_api/types/available_types_10.py +109 -0
- ng_bot_api/types/available_types_11.py +121 -0
- ng_bot_api/types/available_types_12.py +120 -0
- ng_bot_api/types/available_types_13.py +128 -0
- ng_bot_api/types/available_types_14.py +124 -0
- ng_bot_api/types/available_types_15.py +129 -0
- ng_bot_api/types/available_types_16.py +121 -0
- ng_bot_api/types/available_types_17.py +124 -0
- ng_bot_api/types/available_types_18.py +128 -0
- ng_bot_api/types/available_types_19.py +115 -0
- ng_bot_api/types/available_types_20.py +123 -0
- ng_bot_api/types/available_types_21.py +101 -0
- ng_bot_api/types/available_types_22.py +121 -0
- ng_bot_api/types/available_types_23.py +128 -0
- ng_bot_api/types/available_types_24.py +107 -0
- ng_bot_api/types/available_types_25.py +100 -0
- ng_bot_api/types/available_types_26.py +81 -0
- ng_bot_api/types/available_types_27.py +114 -0
- ng_bot_api/types/available_types_28.py +125 -0
- ng_bot_api/types/available_types_29.py +118 -0
- ng_bot_api/types/available_types_30.py +113 -0
- ng_bot_api/types/available_types_31.py +120 -0
- ng_bot_api/types/available_types_32.py +124 -0
- ng_bot_api/types/available_types_33.py +125 -0
- ng_bot_api/types/available_types_34.py +113 -0
- ng_bot_api/types/available_types_35.py +125 -0
- ng_bot_api/types/available_types_36.py +119 -0
- ng_bot_api/types/available_types_37.py +126 -0
- ng_bot_api/types/available_types_38.py +118 -0
- ng_bot_api/types/available_types_39.py +121 -0
- ng_bot_api/types/available_types_40.py +121 -0
- ng_bot_api/types/available_types_41.py +116 -0
- ng_bot_api/types/available_types_42.py +112 -0
- ng_bot_api/types/available_types_43.py +110 -0
- ng_bot_api/types/available_types_44.py +30 -0
- ng_bot_api/types/games_01.py +57 -0
- ng_bot_api/types/getting_updates_01.py +123 -0
- ng_bot_api/types/inline_mode_01.py +124 -0
- ng_bot_api/types/inline_mode_02.py +91 -0
- ng_bot_api/types/inline_mode_03.py +116 -0
- ng_bot_api/types/inline_mode_04.py +126 -0
- ng_bot_api/types/inline_mode_05.py +124 -0
- ng_bot_api/types/inline_mode_06.py +124 -0
- ng_bot_api/types/inline_mode_07.py +119 -0
- ng_bot_api/types/inline_mode_08.py +104 -0
- ng_bot_api/types/inline_mode_09.py +84 -0
- ng_bot_api/types/payments_01.py +124 -0
- ng_bot_api/types/payments_02.py +124 -0
- ng_bot_api/types/payments_03.py +119 -0
- ng_bot_api/types/payments_04.py +70 -0
- ng_bot_api/types/rich_messages_01.py +126 -0
- ng_bot_api/types/rich_messages_02.py +125 -0
- ng_bot_api/types/rich_messages_03.py +115 -0
- ng_bot_api/types/rich_messages_04.py +116 -0
- ng_bot_api/types/rich_messages_05.py +128 -0
- ng_bot_api/types/rich_messages_06.py +125 -0
- ng_bot_api/types/rich_messages_07.py +114 -0
- ng_bot_api/types/rich_messages_08.py +118 -0
- ng_bot_api/types/rich_messages_09.py +124 -0
- ng_bot_api/types/rich_messages_10.py +125 -0
- ng_bot_api/types/rich_messages_11.py +122 -0
- ng_bot_api/types/rich_messages_12.py +122 -0
- ng_bot_api/types/stickers_01.py +107 -0
- ng_bot_api/types/telegram_passport_01.py +120 -0
- ng_bot_api/types/telegram_passport_02.py +113 -0
- ng_bot_api/types/telegram_passport_03.py +24 -0
- ng_bot_api/types/unions_01.py +140 -0
- ng_bot_api/types/unions_02.py +132 -0
- ng_bot_api/types/unions_03.py +134 -0
- ng_bot_api/types/unions_04.py +149 -0
- ng_bot_api/types/unions_05.py +96 -0
- ng_bot_api/webhook.py +78 -0
- ng_bot_api-0.1.0.dist-info/METADATA +179 -0
- ng_bot_api-0.1.0.dist-info/RECORD +193 -0
- ng_bot_api-0.1.0.dist-info/WHEEL +4 -0
- ng_bot_api-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
from ..core.base import BotObject
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from .available_types_12 import Location
|
|
10
|
+
from .rich_messages_01 import RichMessageButton
|
|
11
|
+
from .rich_messages_05 import RichBlockCaption, RichBlockTableCell
|
|
12
|
+
from .unions_03 import RichText
|
|
13
|
+
from .unions_04 import InputRichBlock
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
'InputRichBlockButtons', 'InputRichBlockCollage', 'InputRichBlockDetails',
|
|
17
|
+
'InputRichBlockMap', 'InputRichBlockSlideshow', 'InputRichBlockTable',
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@dataclass(kw_only=True, slots=True)
|
|
22
|
+
class InputRichBlockCollage(BotObject):
|
|
23
|
+
"""A collage, corresponding to the custom HTML tag <tg-collage>.
|
|
24
|
+
|
|
25
|
+
https://core.telegram.org/bots/api#inputrichblockcollage
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
type: str = 'collage'
|
|
29
|
+
"""Type of the block, always “collage”"""
|
|
30
|
+
blocks: list[InputRichBlock]
|
|
31
|
+
"""Elements of the collage"""
|
|
32
|
+
caption: RichBlockCaption | None = None
|
|
33
|
+
"""Optional. Caption of the block"""
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@dataclass(kw_only=True, slots=True)
|
|
37
|
+
class InputRichBlockSlideshow(BotObject):
|
|
38
|
+
"""A slideshow, corresponding to the custom HTML tag <tg-slideshow>.
|
|
39
|
+
|
|
40
|
+
https://core.telegram.org/bots/api#inputrichblockslideshow
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
type: str = 'slideshow'
|
|
44
|
+
"""Type of the block, always “slideshow”"""
|
|
45
|
+
blocks: list[InputRichBlock]
|
|
46
|
+
"""Elements of the slideshow"""
|
|
47
|
+
caption: RichBlockCaption | None = None
|
|
48
|
+
"""Optional. Caption of the block"""
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@dataclass(kw_only=True, slots=True)
|
|
52
|
+
class InputRichBlockTable(BotObject):
|
|
53
|
+
"""A table, corresponding to the HTML tag <table>.
|
|
54
|
+
|
|
55
|
+
https://core.telegram.org/bots/api#inputrichblocktable
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
type: str = 'table'
|
|
59
|
+
"""Type of the block, always “table”"""
|
|
60
|
+
cells: list[list[RichBlockTableCell]]
|
|
61
|
+
"""Cells of the table"""
|
|
62
|
+
is_bordered: bool | None = None
|
|
63
|
+
"""Optional. Pass True if the table has borders"""
|
|
64
|
+
is_striped: bool | None = None
|
|
65
|
+
"""Optional. Pass True if the table is striped"""
|
|
66
|
+
is_compact: bool | None = None
|
|
67
|
+
"""Optional. Pass True if table cells must have smaller indents"""
|
|
68
|
+
caption: RichText | None = None
|
|
69
|
+
"""Optional. Caption of the table"""
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
@dataclass(kw_only=True, slots=True)
|
|
73
|
+
class InputRichBlockDetails(BotObject):
|
|
74
|
+
"""An expandable block for details disclosure, corresponding to the HTML tag <details>.
|
|
75
|
+
|
|
76
|
+
https://core.telegram.org/bots/api#inputrichblockdetails
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
type: str = 'details'
|
|
80
|
+
"""Type of the block, always “details”"""
|
|
81
|
+
summary: RichText
|
|
82
|
+
"""Always shown summary of the block"""
|
|
83
|
+
blocks: list[InputRichBlock]
|
|
84
|
+
"""Content of the block"""
|
|
85
|
+
is_open: bool | None = None
|
|
86
|
+
"""Optional. Pass True if the content of the block is visible by default"""
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
@dataclass(kw_only=True, slots=True)
|
|
90
|
+
class InputRichBlockMap(BotObject):
|
|
91
|
+
"""A block with a map, corresponding to the custom HTML tag <tg-map>. The map's width and height must not exceed 10000 in total. The width and height ratio must be at most 20.
|
|
92
|
+
|
|
93
|
+
https://core.telegram.org/bots/api#inputrichblockmap
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
type: str = 'map'
|
|
97
|
+
"""Type of the block, always “map”"""
|
|
98
|
+
location: Location
|
|
99
|
+
"""Location of the center of the map"""
|
|
100
|
+
zoom: int | None = None
|
|
101
|
+
"""Optional. Map zoom level; 0-24"""
|
|
102
|
+
width: int | None = None
|
|
103
|
+
"""Optional. Map width; 0-10000"""
|
|
104
|
+
height: int | None = None
|
|
105
|
+
"""Optional. Map height; 0-10000"""
|
|
106
|
+
caption: RichBlockCaption | None = None
|
|
107
|
+
"""Optional. Caption of the block"""
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
@dataclass(kw_only=True, slots=True)
|
|
111
|
+
class InputRichBlockButtons(BotObject):
|
|
112
|
+
"""A block containing a list of buttons that are shown in one row, corresponding to the custom HTML tag <tg-button-row>.
|
|
113
|
+
|
|
114
|
+
https://core.telegram.org/bots/api#inputrichblockbuttons
|
|
115
|
+
"""
|
|
116
|
+
|
|
117
|
+
type: str = 'buttons'
|
|
118
|
+
"""Type of the block, always “buttons”"""
|
|
119
|
+
buttons: list[RichMessageButton]
|
|
120
|
+
"""List of 1-8 buttons to send"""
|
|
121
|
+
align: str | None = None
|
|
122
|
+
"""Optional. Horizontal alignment of the buttons. Currently, must be one of “left”, “center”, or “right”."""
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
from ..core.base import BotObject
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from .available_types_40 import InputMediaAnimation, InputMediaAudio
|
|
10
|
+
from .available_types_41 import InputMediaDocument, InputMediaPhoto
|
|
11
|
+
from .available_types_42 import InputMediaVideo, InputMediaVoiceNote
|
|
12
|
+
from .rich_messages_05 import RichBlockCaption
|
|
13
|
+
from .unions_03 import RichText
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
'InputRichBlockAnimation', 'InputRichBlockAudio', 'InputRichBlockDocument',
|
|
17
|
+
'InputRichBlockPhoto', 'InputRichBlockThinking', 'InputRichBlockVideo',
|
|
18
|
+
'InputRichBlockVoiceNote',
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@dataclass(kw_only=True, slots=True)
|
|
23
|
+
class InputRichBlockAnimation(BotObject):
|
|
24
|
+
"""A block with an animation, corresponding to the HTML tag <video>.
|
|
25
|
+
|
|
26
|
+
https://core.telegram.org/bots/api#inputrichblockanimation
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
type: str = 'animation'
|
|
30
|
+
"""Type of the block, always “animation”"""
|
|
31
|
+
animation: InputMediaAnimation
|
|
32
|
+
"""The animation. Caption is ignored."""
|
|
33
|
+
caption: RichBlockCaption | None = None
|
|
34
|
+
"""Optional. Caption of the block"""
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@dataclass(kw_only=True, slots=True)
|
|
38
|
+
class InputRichBlockAudio(BotObject):
|
|
39
|
+
"""A block with a music file, corresponding to the HTML tag <audio>.
|
|
40
|
+
|
|
41
|
+
https://core.telegram.org/bots/api#inputrichblockaudio
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
type: str = 'audio'
|
|
45
|
+
"""Type of the block, always “audio”"""
|
|
46
|
+
audio: InputMediaAudio
|
|
47
|
+
"""The audio. Caption is ignored."""
|
|
48
|
+
caption: RichBlockCaption | None = None
|
|
49
|
+
"""Optional. Caption of the block"""
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@dataclass(kw_only=True, slots=True)
|
|
53
|
+
class InputRichBlockDocument(BotObject):
|
|
54
|
+
"""A block with a general file, corresponding to the custom HTML tag <tg-document>.
|
|
55
|
+
|
|
56
|
+
https://core.telegram.org/bots/api#inputrichblockdocument
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
type: str = 'document'
|
|
60
|
+
"""Type of the block, always “document”"""
|
|
61
|
+
document: InputMediaDocument
|
|
62
|
+
"""The document. Caption is ignored."""
|
|
63
|
+
caption: RichBlockCaption | None = None
|
|
64
|
+
"""Optional. Caption of the block"""
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
@dataclass(kw_only=True, slots=True)
|
|
68
|
+
class InputRichBlockPhoto(BotObject):
|
|
69
|
+
"""A block with a photo, corresponding to the HTML tag <img>.
|
|
70
|
+
|
|
71
|
+
https://core.telegram.org/bots/api#inputrichblockphoto
|
|
72
|
+
"""
|
|
73
|
+
|
|
74
|
+
type: str = 'photo'
|
|
75
|
+
"""Type of the block, always “photo”"""
|
|
76
|
+
photo: InputMediaPhoto
|
|
77
|
+
"""The photo. Caption is ignored."""
|
|
78
|
+
caption: RichBlockCaption | None = None
|
|
79
|
+
"""Optional. Caption of the block"""
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
@dataclass(kw_only=True, slots=True)
|
|
83
|
+
class InputRichBlockVideo(BotObject):
|
|
84
|
+
"""A block with a video, corresponding to the HTML tag <video>.
|
|
85
|
+
|
|
86
|
+
https://core.telegram.org/bots/api#inputrichblockvideo
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
type: str = 'video'
|
|
90
|
+
"""Type of the block, always “video”"""
|
|
91
|
+
video: InputMediaVideo
|
|
92
|
+
"""The video. Caption is ignored."""
|
|
93
|
+
caption: RichBlockCaption | None = None
|
|
94
|
+
"""Optional. Caption of the block"""
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
@dataclass(kw_only=True, slots=True)
|
|
98
|
+
class InputRichBlockVoiceNote(BotObject):
|
|
99
|
+
"""A block with a voice note, corresponding to the HTML tag <audio>.
|
|
100
|
+
|
|
101
|
+
https://core.telegram.org/bots/api#inputrichblockvoicenote
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
type: str = 'voice_note'
|
|
105
|
+
"""Type of the block, always “voice_note”"""
|
|
106
|
+
voice_note: InputMediaVoiceNote
|
|
107
|
+
"""The voice note. Caption is ignored."""
|
|
108
|
+
caption: RichBlockCaption | None = None
|
|
109
|
+
"""Optional. Caption of the block"""
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
@dataclass(kw_only=True, slots=True)
|
|
113
|
+
class InputRichBlockThinking(BotObject):
|
|
114
|
+
"""A block with a “Thinking…” placeholder, corresponding to the custom HTML tag <tg-thinking>. The block may be used only in sendRichMessageDraft; therefore, it can't be received in messages. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block.
|
|
115
|
+
|
|
116
|
+
https://core.telegram.org/bots/api#inputrichblockthinking
|
|
117
|
+
"""
|
|
118
|
+
|
|
119
|
+
type: str = 'thinking'
|
|
120
|
+
"""Type of the block, always “thinking”"""
|
|
121
|
+
text: RichText
|
|
122
|
+
"""Text of the block. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block."""
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
|
+
|
|
6
|
+
from ..core.base import BotObject
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from ..core.input_file import InputFile
|
|
10
|
+
from .available_types_06 import PhotoSize
|
|
11
|
+
from .available_types_20 import File
|
|
12
|
+
|
|
13
|
+
__all__ = ['InputSticker', 'MaskPosition', 'Sticker', 'StickerSet']
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@dataclass(kw_only=True, slots=True)
|
|
17
|
+
class Sticker(BotObject):
|
|
18
|
+
"""This object represents a sticker.
|
|
19
|
+
|
|
20
|
+
https://core.telegram.org/bots/api#sticker
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
file_id: str
|
|
24
|
+
"""Identifier for this file, which can be used to download or reuse the file"""
|
|
25
|
+
file_unique_id: str
|
|
26
|
+
"""Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."""
|
|
27
|
+
type: str
|
|
28
|
+
"""Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video."""
|
|
29
|
+
width: int
|
|
30
|
+
"""Sticker width"""
|
|
31
|
+
height: int
|
|
32
|
+
"""Sticker height"""
|
|
33
|
+
is_animated: bool
|
|
34
|
+
"""True, if the sticker is animated"""
|
|
35
|
+
is_video: bool
|
|
36
|
+
"""True, if the sticker is a video sticker"""
|
|
37
|
+
thumbnail: PhotoSize | None = None
|
|
38
|
+
"""Optional. Sticker thumbnail in the .WEBP or .JPG format"""
|
|
39
|
+
emoji: str | None = None
|
|
40
|
+
"""Optional. Emoji associated with the sticker"""
|
|
41
|
+
set_name: str | None = None
|
|
42
|
+
"""Optional. Name of the sticker set to which the sticker belongs"""
|
|
43
|
+
premium_animation: File | None = None
|
|
44
|
+
"""Optional. For premium regular stickers, premium animation for the sticker"""
|
|
45
|
+
mask_position: MaskPosition | None = None
|
|
46
|
+
"""Optional. For mask stickers, the position where the mask should be placed"""
|
|
47
|
+
custom_emoji_id: str | None = None
|
|
48
|
+
"""Optional. For custom emoji stickers, unique identifier of the custom emoji"""
|
|
49
|
+
needs_repainting: bool | None = None
|
|
50
|
+
"""Optional. True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places"""
|
|
51
|
+
file_size: int | None = None
|
|
52
|
+
"""Optional. File size in bytes"""
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@dataclass(kw_only=True, slots=True)
|
|
56
|
+
class StickerSet(BotObject):
|
|
57
|
+
"""This object represents a sticker set.
|
|
58
|
+
|
|
59
|
+
https://core.telegram.org/bots/api#stickerset
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
name: str
|
|
63
|
+
"""Sticker set name"""
|
|
64
|
+
title: str
|
|
65
|
+
"""Sticker set title"""
|
|
66
|
+
sticker_type: str
|
|
67
|
+
"""Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji”"""
|
|
68
|
+
stickers: list[Sticker]
|
|
69
|
+
"""List of all set stickers"""
|
|
70
|
+
thumbnail: PhotoSize | None = None
|
|
71
|
+
"""Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format"""
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
@dataclass(kw_only=True, slots=True)
|
|
75
|
+
class MaskPosition(BotObject):
|
|
76
|
+
"""This object describes the position on faces where a mask should be placed by default.
|
|
77
|
+
|
|
78
|
+
https://core.telegram.org/bots/api#maskposition
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
point: str
|
|
82
|
+
"""The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”."""
|
|
83
|
+
x_shift: float
|
|
84
|
+
"""Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place the mask just to the left of the default mask position."""
|
|
85
|
+
y_shift: float
|
|
86
|
+
"""Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position."""
|
|
87
|
+
scale: float
|
|
88
|
+
"""Mask scaling coefficient. For example, 2.0 means double size."""
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
@dataclass(kw_only=True, slots=True)
|
|
92
|
+
class InputSticker(BotObject):
|
|
93
|
+
"""This object describes a sticker to be added to a sticker set.
|
|
94
|
+
|
|
95
|
+
https://core.telegram.org/bots/api#inputsticker
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
sticker: InputFile | str
|
|
99
|
+
"""The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new file using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files »"""
|
|
100
|
+
format: str
|
|
101
|
+
"""Format of the added sticker, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, “video” for a .WEBM video"""
|
|
102
|
+
emoji_list: list[str]
|
|
103
|
+
"""List of 1-20 emoji associated with the sticker"""
|
|
104
|
+
mask_position: MaskPosition | None = None
|
|
105
|
+
"""Optional. Position where the mask should be placed on faces. For “mask” stickers only."""
|
|
106
|
+
keywords: list[str] | None = None
|
|
107
|
+
"""Optional. List of 0-20 search keywords for the sticker with a total length of up to 64 characters. For “regular” and “custom_emoji” stickers only."""
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
|
|
5
|
+
from ..core.base import BotObject
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
'EncryptedCredentials', 'EncryptedPassportElement', 'PassportData',
|
|
9
|
+
'PassportElementErrorDataField', 'PassportElementErrorFrontSide', 'PassportFile',
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass(kw_only=True, slots=True)
|
|
14
|
+
class PassportData(BotObject):
|
|
15
|
+
"""Describes Telegram Passport data shared with the bot by the user.
|
|
16
|
+
|
|
17
|
+
https://core.telegram.org/bots/api#passportdata
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
data: list[EncryptedPassportElement]
|
|
21
|
+
"""Array with information shared with the bot about documents and other Telegram Passport elements"""
|
|
22
|
+
credentials: EncryptedCredentials
|
|
23
|
+
"""Encrypted credentials required to decrypt the data"""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@dataclass(kw_only=True, slots=True)
|
|
27
|
+
class PassportFile(BotObject):
|
|
28
|
+
"""This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.
|
|
29
|
+
|
|
30
|
+
https://core.telegram.org/bots/api#passportfile
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
file_id: str
|
|
34
|
+
"""Identifier for this file, which can be used to download or reuse the file"""
|
|
35
|
+
file_unique_id: str
|
|
36
|
+
"""Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."""
|
|
37
|
+
file_size: int
|
|
38
|
+
"""File size in bytes"""
|
|
39
|
+
file_date: int
|
|
40
|
+
"""Unix time when the file was uploaded"""
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@dataclass(kw_only=True, slots=True)
|
|
44
|
+
class EncryptedPassportElement(BotObject):
|
|
45
|
+
"""Describes documents or other Telegram Passport elements shared with the bot by the user.
|
|
46
|
+
|
|
47
|
+
https://core.telegram.org/bots/api#encryptedpassportelement
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
type: str
|
|
51
|
+
"""Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”."""
|
|
52
|
+
data: str | None = None
|
|
53
|
+
"""Optional. Base64-encoded encrypted Telegram Passport element data provided by the user; available only for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials."""
|
|
54
|
+
phone_number: str | None = None
|
|
55
|
+
"""Optional. User's verified phone number; available only for “phone_number” type"""
|
|
56
|
+
email: str | None = None
|
|
57
|
+
"""Optional. User's verified email address; available only for “email” type"""
|
|
58
|
+
files: list[PassportFile] | None = None
|
|
59
|
+
"""Optional. Array of encrypted files with documents provided by the user; available only for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials."""
|
|
60
|
+
front_side: PassportFile | None = None
|
|
61
|
+
"""Optional. Encrypted file with the front side of the document, provided by the user; available only for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials."""
|
|
62
|
+
reverse_side: PassportFile | None = None
|
|
63
|
+
"""Optional. Encrypted file with the reverse side of the document, provided by the user; available only for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials."""
|
|
64
|
+
selfie: PassportFile | None = None
|
|
65
|
+
"""Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available if requested for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials."""
|
|
66
|
+
translation: list[PassportFile] | None = None
|
|
67
|
+
"""Optional. Array of encrypted files with translated versions of documents provided by the user; available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials."""
|
|
68
|
+
hash: str
|
|
69
|
+
"""Base64-encoded element hash for using in PassportElementErrorUnspecified"""
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
@dataclass(kw_only=True, slots=True)
|
|
73
|
+
class EncryptedCredentials(BotObject):
|
|
74
|
+
"""Describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.
|
|
75
|
+
|
|
76
|
+
https://core.telegram.org/bots/api#encryptedcredentials
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
data: str
|
|
80
|
+
"""Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication"""
|
|
81
|
+
hash: str
|
|
82
|
+
"""Base64-encoded data hash for data authentication"""
|
|
83
|
+
secret: str
|
|
84
|
+
"""Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption"""
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
@dataclass(kw_only=True, slots=True)
|
|
88
|
+
class PassportElementErrorDataField(BotObject):
|
|
89
|
+
"""Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes.
|
|
90
|
+
|
|
91
|
+
https://core.telegram.org/bots/api#passportelementerrordatafield
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
source: str = 'data'
|
|
95
|
+
"""Error source, must be data"""
|
|
96
|
+
type: str
|
|
97
|
+
"""The section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”"""
|
|
98
|
+
field_name: str
|
|
99
|
+
"""Name of the data field which has the error"""
|
|
100
|
+
data_hash: str
|
|
101
|
+
"""Base64-encoded data hash"""
|
|
102
|
+
message: str
|
|
103
|
+
"""Error message"""
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
@dataclass(kw_only=True, slots=True)
|
|
107
|
+
class PassportElementErrorFrontSide(BotObject):
|
|
108
|
+
"""Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes.
|
|
109
|
+
|
|
110
|
+
https://core.telegram.org/bots/api#passportelementerrorfrontside
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
source: str = 'front_side'
|
|
114
|
+
"""Error source, must be front_side"""
|
|
115
|
+
type: str
|
|
116
|
+
"""The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”"""
|
|
117
|
+
file_hash: str
|
|
118
|
+
"""Base64-encoded hash of the file with the front side of the document"""
|
|
119
|
+
message: str
|
|
120
|
+
"""Error message"""
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
|
|
5
|
+
from ..core.base import BotObject
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
'PassportElementErrorFile', 'PassportElementErrorFiles', 'PassportElementErrorReverseSide',
|
|
9
|
+
'PassportElementErrorSelfie', 'PassportElementErrorTranslationFile',
|
|
10
|
+
'PassportElementErrorTranslationFiles',
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass(kw_only=True, slots=True)
|
|
15
|
+
class PassportElementErrorReverseSide(BotObject):
|
|
16
|
+
"""Represents an issue with the reverse side of a document. The error is considered resolved when the file with the reverse side of the document changes.
|
|
17
|
+
|
|
18
|
+
https://core.telegram.org/bots/api#passportelementerrorreverseside
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
source: str = 'reverse_side'
|
|
22
|
+
"""Error source, must be reverse_side"""
|
|
23
|
+
type: str
|
|
24
|
+
"""The section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card”"""
|
|
25
|
+
file_hash: str
|
|
26
|
+
"""Base64-encoded hash of the file with the reverse side of the document"""
|
|
27
|
+
message: str
|
|
28
|
+
"""Error message"""
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@dataclass(kw_only=True, slots=True)
|
|
32
|
+
class PassportElementErrorSelfie(BotObject):
|
|
33
|
+
"""Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.
|
|
34
|
+
|
|
35
|
+
https://core.telegram.org/bots/api#passportelementerrorselfie
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
source: str = 'selfie'
|
|
39
|
+
"""Error source, must be selfie"""
|
|
40
|
+
type: str
|
|
41
|
+
"""The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”"""
|
|
42
|
+
file_hash: str
|
|
43
|
+
"""Base64-encoded hash of the file with the selfie"""
|
|
44
|
+
message: str
|
|
45
|
+
"""Error message"""
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@dataclass(kw_only=True, slots=True)
|
|
49
|
+
class PassportElementErrorFile(BotObject):
|
|
50
|
+
"""Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.
|
|
51
|
+
|
|
52
|
+
https://core.telegram.org/bots/api#passportelementerrorfile
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
source: str = 'file'
|
|
56
|
+
"""Error source, must be file"""
|
|
57
|
+
type: str
|
|
58
|
+
"""The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”"""
|
|
59
|
+
file_hash: str
|
|
60
|
+
"""Base64-encoded file hash"""
|
|
61
|
+
message: str
|
|
62
|
+
"""Error message"""
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
@dataclass(kw_only=True, slots=True)
|
|
66
|
+
class PassportElementErrorFiles(BotObject):
|
|
67
|
+
"""Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.
|
|
68
|
+
|
|
69
|
+
https://core.telegram.org/bots/api#passportelementerrorfiles
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
source: str = 'files'
|
|
73
|
+
"""Error source, must be files"""
|
|
74
|
+
type: str
|
|
75
|
+
"""The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”"""
|
|
76
|
+
file_hashes: list[str]
|
|
77
|
+
"""List of base64-encoded file hashes"""
|
|
78
|
+
message: str
|
|
79
|
+
"""Error message"""
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
@dataclass(kw_only=True, slots=True)
|
|
83
|
+
class PassportElementErrorTranslationFile(BotObject):
|
|
84
|
+
"""Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.
|
|
85
|
+
|
|
86
|
+
https://core.telegram.org/bots/api#passportelementerrortranslationfile
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
source: str = 'translation_file'
|
|
90
|
+
"""Error source, must be translation_file"""
|
|
91
|
+
type: str
|
|
92
|
+
"""Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”"""
|
|
93
|
+
file_hash: str
|
|
94
|
+
"""Base64-encoded file hash"""
|
|
95
|
+
message: str
|
|
96
|
+
"""Error message"""
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
@dataclass(kw_only=True, slots=True)
|
|
100
|
+
class PassportElementErrorTranslationFiles(BotObject):
|
|
101
|
+
"""Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation changes.
|
|
102
|
+
|
|
103
|
+
https://core.telegram.org/bots/api#passportelementerrortranslationfiles
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
source: str = 'translation_files'
|
|
107
|
+
"""Error source, must be translation_files"""
|
|
108
|
+
type: str
|
|
109
|
+
"""Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”"""
|
|
110
|
+
file_hashes: list[str]
|
|
111
|
+
"""List of base64-encoded file hashes"""
|
|
112
|
+
message: str
|
|
113
|
+
"""Error message"""
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
|
|
5
|
+
from ..core.base import BotObject
|
|
6
|
+
|
|
7
|
+
__all__ = ['PassportElementErrorUnspecified']
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass(kw_only=True, slots=True)
|
|
11
|
+
class PassportElementErrorUnspecified(BotObject):
|
|
12
|
+
"""Represents an issue in an unspecified place. The error is considered resolved when new data is added.
|
|
13
|
+
|
|
14
|
+
https://core.telegram.org/bots/api#passportelementerrorunspecified
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
source: str = 'unspecified'
|
|
18
|
+
"""Error source, must be unspecified"""
|
|
19
|
+
type: str
|
|
20
|
+
"""Type of element of the user's Telegram Passport which has the issue"""
|
|
21
|
+
element_hash: str
|
|
22
|
+
"""Base64-encoded element hash"""
|
|
23
|
+
message: str
|
|
24
|
+
"""Error message"""
|