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
ng_bot_api/webhook.py
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import hmac
|
|
4
|
+
import inspect
|
|
5
|
+
import json
|
|
6
|
+
from typing import Any, Awaitable, Callable, Mapping, Union
|
|
7
|
+
|
|
8
|
+
from .types import Update
|
|
9
|
+
|
|
10
|
+
secretHeader = "X-Telegram-Bot-Api-Secret-Token"
|
|
11
|
+
UpdateCallback = Callable[[Update], Union[Any, Awaitable[Any]]]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class WebhookHandler:
|
|
15
|
+
"""Framework-agnostic webhook endpoint logic.
|
|
16
|
+
|
|
17
|
+
Feed it the raw request body and headers from any web framework; it validates the secret token
|
|
18
|
+
header, parses the ``Update`` and passes it to ``on_update`` (sync or async callable).
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
def __init__(self, on_update: UpdateCallback, secret_token: str | None = None) -> None:
|
|
22
|
+
self.on_update = on_update
|
|
23
|
+
self.secret_token = secret_token
|
|
24
|
+
|
|
25
|
+
def check_secret(self, headers: Mapping[str, str]) -> bool:
|
|
26
|
+
if self.secret_token is None:
|
|
27
|
+
return True
|
|
28
|
+
lowered = {key.lower(): value for key, value in headers.items()}
|
|
29
|
+
received = lowered.get(secretHeader.lower(), "")
|
|
30
|
+
return hmac.compare_digest(received.encode(), self.secret_token.encode())
|
|
31
|
+
|
|
32
|
+
@staticmethod
|
|
33
|
+
def parse(body: bytes | str) -> Update:
|
|
34
|
+
return Update.from_dict(json.loads(body))
|
|
35
|
+
|
|
36
|
+
async def handle(self, body: bytes | str, headers: Mapping[str, str]) -> tuple[int, bytes]:
|
|
37
|
+
"""Process one webhook request and return ``(status_code, response_body)``."""
|
|
38
|
+
if not self.check_secret(headers):
|
|
39
|
+
return 401, b"unauthorized"
|
|
40
|
+
try:
|
|
41
|
+
update = self.parse(body)
|
|
42
|
+
except (ValueError, TypeError):
|
|
43
|
+
return 400, b"bad request"
|
|
44
|
+
result = self.on_update(update)
|
|
45
|
+
if inspect.isawaitable(result):
|
|
46
|
+
await result
|
|
47
|
+
return 200, b""
|
|
48
|
+
|
|
49
|
+
def asgi_app(self, path: str = "/") -> Callable[..., Awaitable[None]]:
|
|
50
|
+
"""Return a minimal ASGI application (uvicorn, hypercorn, Starlette mount, ...)."""
|
|
51
|
+
|
|
52
|
+
async def app(scope: dict[str, Any], receive: Callable[..., Any], send: Callable[..., Any]) -> None:
|
|
53
|
+
if scope["type"] != "http":
|
|
54
|
+
return
|
|
55
|
+
status, payload = 404, b"not found"
|
|
56
|
+
if scope["path"] == path and scope["method"] == "POST":
|
|
57
|
+
body = b""
|
|
58
|
+
more = True
|
|
59
|
+
while more:
|
|
60
|
+
message = await receive()
|
|
61
|
+
body += message.get("body", b"")
|
|
62
|
+
more = message.get("more_body", False)
|
|
63
|
+
headers = {key.decode("latin-1"): value.decode("latin-1") for key, value in scope["headers"]}
|
|
64
|
+
status, payload = await self.handle(body, headers)
|
|
65
|
+
await send({"type": "http.response.start", "status": status, "headers": [(b"content-type", b"text/plain")]})
|
|
66
|
+
await send({"type": "http.response.body", "body": payload})
|
|
67
|
+
|
|
68
|
+
return app
|
|
69
|
+
|
|
70
|
+
def aiohttp_handler(self) -> Callable[..., Awaitable[Any]]:
|
|
71
|
+
"""Return an aiohttp request handler: ``app.router.add_post("/webhook", handler)``."""
|
|
72
|
+
from aiohttp import web
|
|
73
|
+
|
|
74
|
+
async def handler(request: Any) -> Any:
|
|
75
|
+
status, payload = await self.handle(await request.read(), request.headers)
|
|
76
|
+
return web.Response(status=status, body=payload)
|
|
77
|
+
|
|
78
|
+
return handler
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: ng-bot-api
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Official typed Python client for the NetGram Bot API (Telegram Bot API compatible): sync + asyncio, long polling, webhooks, dispatcher
|
|
5
|
+
Project-URL: Homepage, https://netgram.su
|
|
6
|
+
Project-URL: Documentation, https://netgram.su
|
|
7
|
+
Project-URL: Repository, https://github.com/NetGram-su/ng-bot-api
|
|
8
|
+
Author: NetGram
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: asyncio,bot,bot-api,netgram,telegram
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Framework :: AsyncIO
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Communications :: Chat
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Requires-Dist: httpx<1,>=0.25
|
|
27
|
+
Provides-Extra: aiohttp
|
|
28
|
+
Requires-Dist: aiohttp>=3.9; extra == 'aiohttp'
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# ng-bot-api
|
|
35
|
+
|
|
36
|
+
Official typed Python client for the **NetGram Bot API** — a 1:1 implementation of the
|
|
37
|
+
[Telegram Bot API](https://core.telegram.org/bots/api) (currently **Bot API 10.5**, 194 methods, 426 types).
|
|
38
|
+
|
|
39
|
+
- sync (`Bot`) and asyncio (`AsyncBot`) clients on top of [httpx](https://www.python-httpx.org/)
|
|
40
|
+
- every method and type generated from the official spec, with docstrings and type hints (`py.typed`)
|
|
41
|
+
- file uploads (`InputFile`, automatic `attach://` for media groups), file downloads
|
|
42
|
+
- long polling, framework-agnostic webhook handler (ASGI app / aiohttp handler)
|
|
43
|
+
- small dispatcher with routers and filters (`Command`, `CallbackData`, `Text`, `Regexp`, `ChatType`)
|
|
44
|
+
- typed errors (`TooManyRequestsError.retry_after`, `ForbiddenError`, ...)
|
|
45
|
+
- default server `https://api.netgram.su`, any Bot API compatible server can be used via `api_url`
|
|
46
|
+
|
|
47
|
+
[Русская версия ниже](#ng-bot-api-ru)
|
|
48
|
+
|
|
49
|
+
## Install
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pip install ng-bot-api # import name: ng_bot_api
|
|
53
|
+
pip install "ng-bot-api[aiohttp]" # + aiohttp for the webhook example
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Quick start
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
import os
|
|
60
|
+
from ng_bot_api import AsyncBot, Command, Dispatcher
|
|
61
|
+
from ng_bot_api.types import Message
|
|
62
|
+
|
|
63
|
+
dp = Dispatcher()
|
|
64
|
+
|
|
65
|
+
@dp.message(Command("start"))
|
|
66
|
+
async def start(message: Message, bot: AsyncBot, command):
|
|
67
|
+
await bot.send_message(message.chat.id, "Hello! Payload: " + str(command.args))
|
|
68
|
+
|
|
69
|
+
@dp.message()
|
|
70
|
+
async def echo(message: Message, bot: AsyncBot):
|
|
71
|
+
await bot.send_message(message.chat.id, message.text or "?")
|
|
72
|
+
|
|
73
|
+
dp.run_polling(AsyncBot(os.environ["BOT_TOKEN"]))
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Synchronous client:
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
from ng_bot_api import Bot, InputFile
|
|
80
|
+
|
|
81
|
+
with Bot(token) as bot:
|
|
82
|
+
bot.send_photo(chat_id, InputFile.from_path("cat.jpg"), caption="Cat")
|
|
83
|
+
for update in bot.iter_updates():
|
|
84
|
+
...
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Handlers receive the event first and can declare `bot`, `update`, `event_type` and names injected by
|
|
88
|
+
filters: `command` (`Command`), `callback_args` (`CallbackData`), `match` (`Regexp`).
|
|
89
|
+
Filters combine with `&`, `|`, `~`; any callable `event -> bool` works as a filter.
|
|
90
|
+
|
|
91
|
+
## Keyboards and callbacks
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
from ng_bot_api import CallbackData
|
|
95
|
+
from ng_bot_api.types import InlineKeyboardButton, InlineKeyboardMarkup
|
|
96
|
+
|
|
97
|
+
markup = InlineKeyboardMarkup(inline_keyboard=[[InlineKeyboardButton(text="Buy", callback_data="buy:42")]])
|
|
98
|
+
await bot.send_message(chat_id, "Shop", reply_markup=markup)
|
|
99
|
+
|
|
100
|
+
@dp.callback_query(CallbackData("buy"))
|
|
101
|
+
async def buy(query, bot, callback_args):
|
|
102
|
+
await bot.answer_callback_query(query.id, text="Item " + callback_args[0])
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Webhook
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
from ng_bot_api import WebhookHandler
|
|
109
|
+
|
|
110
|
+
handler = WebhookHandler(dp.webhook_callback(bot), secret_token="random-secret")
|
|
111
|
+
app = handler.asgi_app("/webhook") # run with uvicorn / hypercorn
|
|
112
|
+
aiohttp_view = handler.aiohttp_handler() # or app.router.add_post("/webhook", aiohttp_view)
|
|
113
|
+
await bot.set_webhook("https://example.com/webhook", secret_token="random-secret")
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
`WebhookHandler.handle(body, headers)` returns `(status, body)` and can be wired into any framework.
|
|
117
|
+
|
|
118
|
+
## Custom server
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
bot = AsyncBot(token, api_url="https://api.telegram.org") # works with Telegram too
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Errors
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
from ng_bot_api import BotApiError, TooManyRequestsError
|
|
128
|
+
|
|
129
|
+
try:
|
|
130
|
+
await bot.send_message(chat_id, "hi")
|
|
131
|
+
except TooManyRequestsError as error:
|
|
132
|
+
await asyncio.sleep(error.retry_after)
|
|
133
|
+
except BotApiError as error:
|
|
134
|
+
print(error.error_code, error.description)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Field `from` is exposed as `from_user`. Objects convert with `to_dict()` / `from_dict()`.
|
|
138
|
+
Examples: [`examples/`](examples). License: MIT.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
<a id="ng-bot-api-ru"></a>
|
|
143
|
+
# ng-bot-api (RU)
|
|
144
|
+
|
|
145
|
+
Официальная типизированная Python-библиотека для **NetGram Bot API** — полной копии
|
|
146
|
+
[Telegram Bot API](https://core.telegram.org/bots/api) (сейчас **Bot API 10.5**: 194 метода, 426 типов).
|
|
147
|
+
|
|
148
|
+
- синхронный `Bot` и асинхронный `AsyncBot` (httpx);
|
|
149
|
+
- все методы и типы сгенерированы из официальной спецификации, с подсказками типов и докстрингами;
|
|
150
|
+
- загрузка файлов (`InputFile`, автоматический `attach://` для альбомов) и скачивание (`download_file`);
|
|
151
|
+
- long polling (`iter_updates`, `Dispatcher.run_polling`) и вебхуки (`WebhookHandler`: ASGI или aiohttp);
|
|
152
|
+
- диспетчер с роутерами и фильтрами `Command`, `CallbackData`, `Text`, `Regexp`, `ChatType`;
|
|
153
|
+
- типизированные ошибки: `TooManyRequestsError.retry_after`, `ForbiddenError` и т.д.;
|
|
154
|
+
- сервер по умолчанию `https://api.netgram.su`, другой задаётся через `api_url`.
|
|
155
|
+
|
|
156
|
+
## Установка
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
pip install ng-bot-api
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Пример: эхо-бот
|
|
163
|
+
|
|
164
|
+
```python
|
|
165
|
+
import os
|
|
166
|
+
from ng_bot_api import AsyncBot, Dispatcher
|
|
167
|
+
|
|
168
|
+
dp = Dispatcher()
|
|
169
|
+
|
|
170
|
+
@dp.message()
|
|
171
|
+
async def echo(message, bot):
|
|
172
|
+
await bot.send_message(message.chat.id, message.text or "?")
|
|
173
|
+
|
|
174
|
+
dp.run_polling(AsyncBot(os.environ["BOT_TOKEN"]))
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Токен бота выдаёт системный бот NetGram для создания ботов. Для работы с Telegram передайте
|
|
178
|
+
`api_url="https://api.telegram.org"`. Полные примеры — в папке [`examples/`](examples):
|
|
179
|
+
эхо-бот, inline-клавиатура с callback-кнопками, вебхук на aiohttp. Лицензия MIT.
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
ng_bot_api/__init__.py,sha256=hPfrX2q2n8L5dlNNAEOg0bvi2JDgJDvIfW9vt6DPNqU,1208
|
|
2
|
+
ng_bot_api/api_version.py,sha256=GYq8l5uX4o-BSxNHlQmHhkH7NRT3Yu_JCr-RIwAQ3zc,60
|
|
3
|
+
ng_bot_api/async_bot.py,sha256=kE-MV7XkIb-q95BgRKVIxse5K65WTqun730D4rsVZxA,3786
|
|
4
|
+
ng_bot_api/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
ng_bot_api/sync_bot.py,sha256=40wAXH6wF6pCp4DaMRt65WzhnVY0qPrSvz5EAWdyBBc,3600
|
|
6
|
+
ng_bot_api/webhook.py,sha256=iopWI01Ye5_l4szCDrD22KNjD2qtpAohAwyzR-wQUcI,3197
|
|
7
|
+
ng_bot_api/core/__init__.py,sha256=TLScI-SHMMq7Vo5bHqhXm-x-TyqXz62e1moTh_lxOTI,609
|
|
8
|
+
ng_bot_api/core/base.py,sha256=q-iZlaFKWoaP4PT8B56wSpBNIbHSFjUr4BIwI-NhL0s,1103
|
|
9
|
+
ng_bot_api/core/caller.py,sha256=7gCJhOZ1mGyq9YeqC2hP0PeVsX72KLmYjxAn3cS5C1Y,372
|
|
10
|
+
ng_bot_api/core/decoding.py,sha256=Lhz16htcIj7w62GVTEWUuPUdb4nAL50jhr_Jg8FsUAA,3035
|
|
11
|
+
ng_bot_api/core/encoding.py,sha256=nM9n2GXjHPumE4PXPYB9msDBPIfP8lFEokHdMFY2xO0,1350
|
|
12
|
+
ng_bot_api/core/errors.py,sha256=dP0K21J9RxIOd_MWc_iGmWuepwJFVbOmpXqK4qyLIWE,2272
|
|
13
|
+
ng_bot_api/core/input_file.py,sha256=DxTn1KHJxpNQuAVOx8U9cjaeo5eloIGGMcenmLNzIBI,2098
|
|
14
|
+
ng_bot_api/core/polling.py,sha256=56jaq3huOfRiSeXpmQFlSKeaDOTmv4l3hYVy-HyzE4c,1395
|
|
15
|
+
ng_bot_api/core/registry.py,sha256=haeueFsQNU8WpZcthoKUevFAgajP8rs3ibOS4U-BFr8,1897
|
|
16
|
+
ng_bot_api/core/request.py,sha256=yb8nSPZulrvXSySsZeXhvuoMw8cKbl0Y8sPB5ipAp8Q,2555
|
|
17
|
+
ng_bot_api/core/typespec.py,sha256=jpfVWjNMeeOGXW28ht7n1NVhIyQmHPz5N_6YSpQsvgs,1701
|
|
18
|
+
ng_bot_api/dispatcher/__init__.py,sha256=6RsVKMN7AQBGSVD_W0EIcjnD9ImPu5Ltt4lrX4upvWM,373
|
|
19
|
+
ng_bot_api/dispatcher/dispatcher.py,sha256=sdcebWJ5mhT5Jvdh8KeHY8DeewGlU7yMFIAUqIxyYHI,3397
|
|
20
|
+
ng_bot_api/dispatcher/filter_base.py,sha256=2igpT7OHxD-_i5ftW_IADPdNYxqmODOR9CPENbx5hio,2424
|
|
21
|
+
ng_bot_api/dispatcher/filters.py,sha256=Sczcvs__DTKwTvJDIJnGXY-4BLoEYvTk4VroOKmmlac,4630
|
|
22
|
+
ng_bot_api/dispatcher/handler.py,sha256=T6IIwhcJs0ZqHlSMumrZlz4eR2gsBsaS5u_W-DvHl6s,1355
|
|
23
|
+
ng_bot_api/dispatcher/router.py,sha256=lKkQwMg2dw7t9qldQns7WdB1OwL2EmcqRgPK99Fg1WA,2749
|
|
24
|
+
ng_bot_api/methods/__init__.py,sha256=GA6aGVM3-AizkBWbvgXcNlLa8KnM93qgxy71wWdkbwc,4557
|
|
25
|
+
ng_bot_api/methods/async_01.py,sha256=e5YROTDQfzIYM67in6LPlW0pMyjo1-JN4l2NU5Xg_EI,7228
|
|
26
|
+
ng_bot_api/methods/async_02.py,sha256=3Tflzp8BcyT-xxBwojczwktub62UQ5VSigZrCVf9QDs,8064
|
|
27
|
+
ng_bot_api/methods/async_03.py,sha256=fVpBNWZvQrIivqDtbgx0QCrZB5PY31FtZf-iroRoKV4,6671
|
|
28
|
+
ng_bot_api/methods/async_04.py,sha256=CVUXHuKD0aoXbBr9kgw1UXo_cT9EM8d5_34i4s-zADQ,9036
|
|
29
|
+
ng_bot_api/methods/async_05.py,sha256=5bSU9OhCKrKHzAKZFEKg3BXfhTdldYBsaHIxxhqh1j8,9904
|
|
30
|
+
ng_bot_api/methods/async_06.py,sha256=IitEvNpfGyTLNvOJ_I7C-yW9-D_0rIdHr6Oz4Y1u3zk,6087
|
|
31
|
+
ng_bot_api/methods/async_07.py,sha256=WP9UOPur22qW3dL2oOjm8XJdyg2eNZQrPzxzufjrpW0,9639
|
|
32
|
+
ng_bot_api/methods/async_08.py,sha256=w52iydMswnEUWsLFO-iZIdveNETgG4so67tnwkv2jFM,8435
|
|
33
|
+
ng_bot_api/methods/async_09.py,sha256=06a5aeVWaS_m1MUR7-yT3sKuibfvr1-w2DpJM6duqFM,6945
|
|
34
|
+
ng_bot_api/methods/async_10.py,sha256=D-c6wUF_tCdUivwfF2BWUSxYbSYdbv1u7PCx8sGEbcM,6724
|
|
35
|
+
ng_bot_api/methods/async_11.py,sha256=ZKh3wV1-gT1ZzID_6kdNNKeqOQnu9Vhu2ys0Vq8HstU,7357
|
|
36
|
+
ng_bot_api/methods/async_12.py,sha256=YFN9VlWsl9VjxLhN-25tuhLNvJdLG9LiYWqCVyHo7ec,8503
|
|
37
|
+
ng_bot_api/methods/async_13.py,sha256=RCDkf3Ioo6YuIJyI1_JmA1RawsjXrsteThPjYefV4p0,8717
|
|
38
|
+
ng_bot_api/methods/async_14.py,sha256=96NlWNK0Nc2lEMJLMU09D7nwzEh1qPlaGVx2Oq5o1pI,5847
|
|
39
|
+
ng_bot_api/methods/async_15.py,sha256=9qp2Eqpa5KenCYcNy9cRoiqxG47jPZbtRGTSfQWyuzY,7561
|
|
40
|
+
ng_bot_api/methods/async_16.py,sha256=ssWtAc1qcs-0eof6DQSxqPzwyBILT3NrEWc7NOYQXPI,6301
|
|
41
|
+
ng_bot_api/methods/async_17.py,sha256=0swhVMsjtlhuebymV6U1xaanmX2x5HqdHLvaGDE9K0o,5881
|
|
42
|
+
ng_bot_api/methods/async_18.py,sha256=gJGy9X8JHOibgAEHIiCAcDFPHcZitB7serzk7fcw5iA,6037
|
|
43
|
+
ng_bot_api/methods/async_19.py,sha256=RE8rVj6SY3lRm8yV-Ux6UhBC55TH2-l3NwiZHzFAnFw,5801
|
|
44
|
+
ng_bot_api/methods/async_20.py,sha256=BuLmUh9ss_Q8Gt1uEOlsSfP7SkdyLu5P6RSL4LgAuh0,6521
|
|
45
|
+
ng_bot_api/methods/async_21.py,sha256=xPdA9Omuo_omiNSBjb84gZplPRygr5EEuJ5zAMPrIGE,6616
|
|
46
|
+
ng_bot_api/methods/async_22.py,sha256=KVK-lrxdhGYWwPHngeOkdmE9ySZfMQT5a8V4KaHgvII,4296
|
|
47
|
+
ng_bot_api/methods/async_23.py,sha256=P2pdI6nMA_0WyIZSxDBdkNaH8NaI5l0DqraMq6bnq24,7160
|
|
48
|
+
ng_bot_api/methods/async_24.py,sha256=mU_HfD9AHVZ8lP53RcQ9sOofaHnL9GP_KpG682PftYk,4769
|
|
49
|
+
ng_bot_api/methods/async_25.py,sha256=yg6mACMHByHNx7EABgIPPnIjkDQgunepYXWhg4qAJh4,6249
|
|
50
|
+
ng_bot_api/methods/async_26.py,sha256=Im8nqRegCWPiKnOUFVPpMyZnNQlUmx9xH6l1xLpFvQc,6159
|
|
51
|
+
ng_bot_api/methods/async_27.py,sha256=tPE9-qvQ9_K4SdbUBoBmHQJ03UuJmJH9M2JjUJjktfw,5267
|
|
52
|
+
ng_bot_api/methods/async_28.py,sha256=mJ7T07CyJySMtQ4ZEVsAHTqlJ4eVsDF8Hi-c1nt4-as,6807
|
|
53
|
+
ng_bot_api/methods/async_29.py,sha256=Pgmm5VzHT5P2cRCDxkc6ccwoDNttxCG_DeCEQZlA6Ds,5549
|
|
54
|
+
ng_bot_api/methods/async_30.py,sha256=GmBxk6eWHLLzbIe_m75iksXmnM_7yfEyJHM1Vvaa6c4,5421
|
|
55
|
+
ng_bot_api/methods/async_31.py,sha256=XKZCMYEsij77iX0FUJGhfh9FBaLUDn6BWcfr8rQIvV0,7527
|
|
56
|
+
ng_bot_api/methods/async_32.py,sha256=3fvDWgdUSsW8rkxXalTnq6vMELOm1v5ubOfN9PwSoI0,7463
|
|
57
|
+
ng_bot_api/methods/async_33.py,sha256=q6I2W4KvFz8_jMcizq7VZqjGi-mh6t5TCKIlakOQHJ4,5507
|
|
58
|
+
ng_bot_api/methods/async_34.py,sha256=Fa4Muqjnfrsu6X0qAtXvEhx9BaKzjOgks6UcRnab04s,6120
|
|
59
|
+
ng_bot_api/methods/async_35.py,sha256=Xg1L1LZ3i6rSzVR5p05b_dxB7DkYSkDW45yWWJzVVVY,7347
|
|
60
|
+
ng_bot_api/methods/async_36.py,sha256=TmiBFMPVmKCl_j-9cEKFKc6HFmWa0h3oGFztkW9f6x0,5318
|
|
61
|
+
ng_bot_api/methods/async_37.py,sha256=1xPNJ3dugis0tNxmHHEZLn-sOFMs0foJbOO73A4juQI,5939
|
|
62
|
+
ng_bot_api/methods/async_38.py,sha256=89JCVwhKFkOp_mi3jfUSdmzyK4uyBD6YmUJFx4rLSKI,7208
|
|
63
|
+
ng_bot_api/methods/async_39.py,sha256=Xxk2mcei2OSqtFkexmmXS0qU1RmvMVk_b1Jo2xirqPQ,6827
|
|
64
|
+
ng_bot_api/methods/async_40.py,sha256=CdU4-ekvp0otvG-7rfn_l0KsbfF0opaJWV7TQHwMIIg,8583
|
|
65
|
+
ng_bot_api/methods/async_41.py,sha256=2GoVm6pxSPNPatB8aY0KzyjBQDXQ4-7JvxngefsJl0c,6317
|
|
66
|
+
ng_bot_api/methods/async_42.py,sha256=9PI23OwazlCdYez58KovywQPQcy28iDIQ07K1QXT5w8,1395
|
|
67
|
+
ng_bot_api/methods/sync_01.py,sha256=cU53YhzM3PvPk0DaN0Uj7qbVJ7M67Kklv9rluhQhQV8,7141
|
|
68
|
+
ng_bot_api/methods/sync_02.py,sha256=Bt3K4BCV_MNAGEWozJrSItreSB6J8-wj3WgrMhwwecw,8025
|
|
69
|
+
ng_bot_api/methods/sync_03.py,sha256=3pKU6SajMe-_oBNWJ-SuAVLm-6zFMXfq0hom5hsUGuE,6644
|
|
70
|
+
ng_bot_api/methods/sync_04.py,sha256=y7TH4NZZJMYoHy6q2hZ47hRMC09n_fXaD61OKdvkAJM,9009
|
|
71
|
+
ng_bot_api/methods/sync_05.py,sha256=gKfYZ3seVkSxPwBcYNn8z0HA4RmSv_RPuznkTWyk6ME,9877
|
|
72
|
+
ng_bot_api/methods/sync_06.py,sha256=nLvDvhSQz3suT0Z4_j2nAPy2DMh3WfCMJIbH2fmeKYM,6072
|
|
73
|
+
ng_bot_api/methods/sync_07.py,sha256=K8Ak7R4RPhgjm0bGLMWhgMSU5Vp6H6BIPBrbi43SAYI,9612
|
|
74
|
+
ng_bot_api/methods/sync_08.py,sha256=G5hKl1csV2hxa11nNQ8H0N3Ews3Us2cojmLZ0kocK1U,8408
|
|
75
|
+
ng_bot_api/methods/sync_09.py,sha256=TKOJO8k3ssZOgyqyRQ0L2s9r9NoJUriYkiyK6c1JLK8,6918
|
|
76
|
+
ng_bot_api/methods/sync_10.py,sha256=fzkht1G3c9v9gMWmwLn3i-R8yNRIQ7jmoAbn9wzLo4w,6697
|
|
77
|
+
ng_bot_api/methods/sync_11.py,sha256=ohZ74lKPFWgIUq0YVWuxsNqISFsyHDwzq9hxdkOyCT0,7330
|
|
78
|
+
ng_bot_api/methods/sync_12.py,sha256=5R25TMEMyn11poKtj1PQCoDXYJZkOp7plBGYqkP-8xY,8476
|
|
79
|
+
ng_bot_api/methods/sync_13.py,sha256=FrJHjh0A-Ay-i_TJZRiqJxegkgm0mq0uDLZbFz0Ci7c,8666
|
|
80
|
+
ng_bot_api/methods/sync_14.py,sha256=TGBLFYJs4J6DKsDkgR-0jGDen6Dyyzz8nsS41Pf20Zg,5772
|
|
81
|
+
ng_bot_api/methods/sync_15.py,sha256=0chsF06AJGMOwSjYUtyYB4nKohUBKRNcF-J1PvEJkbs,7510
|
|
82
|
+
ng_bot_api/methods/sync_16.py,sha256=kEEM3yfIyijrzPeuJHB-exrs4kvfBU0uc01Y9VFXIik,6226
|
|
83
|
+
ng_bot_api/methods/sync_17.py,sha256=pjSK-ekaqbUpEhiNsg0uuB2HxyxfGXtJMMXIYIONXG0,5794
|
|
84
|
+
ng_bot_api/methods/sync_18.py,sha256=_Fv-SsVWB6mqpA_J1aU_z9DRLbrW2f9loxeaaQCkMKA,5950
|
|
85
|
+
ng_bot_api/methods/sync_19.py,sha256=wb1UpdCt7tTEU1JVnURTVIurnyBGjYIE_LUnERrMXd0,5690
|
|
86
|
+
ng_bot_api/methods/sync_20.py,sha256=TnqAm9o_wBTbd1ZEW6FRcdD2PO1JVLaZrN--mwMj-mE,6434
|
|
87
|
+
ng_bot_api/methods/sync_21.py,sha256=EFoSEP3OTVJ3IMaaJboxiXktefesHDDl69_xalWKro0,6517
|
|
88
|
+
ng_bot_api/methods/sync_22.py,sha256=zGckoIUqJK0Hlcrai8NsxekuSNmhj6Y5NhdwccnQoYk,4209
|
|
89
|
+
ng_bot_api/methods/sync_23.py,sha256=hHNE0wL_SYxB3e8FzXzuoaXFkrMvrPk1A4uSTfx95hw,7097
|
|
90
|
+
ng_bot_api/methods/sync_24.py,sha256=u7zPKUEZ2jynie4pqqmiXbWOptvaY9RWgQJ02Lwe0ps,4670
|
|
91
|
+
ng_bot_api/methods/sync_25.py,sha256=RWNx5_imTx0wvg2AEkjaRrkgDnP-95aUmHELsu4jsYo,6174
|
|
92
|
+
ng_bot_api/methods/sync_26.py,sha256=CfoSvGNqVo6LJJ5BvotOxLt146P6dvNoMEARqdkKNVM,6072
|
|
93
|
+
ng_bot_api/methods/sync_27.py,sha256=M_22PfLA3L8j52Ymhe4MsKt5avvTmxoCBf0fmW546ws,5180
|
|
94
|
+
ng_bot_api/methods/sync_28.py,sha256=pen_2s0yCGdWjvrQKqYQ57YjMECFmqLZVzgm5hDT1N4,6756
|
|
95
|
+
ng_bot_api/methods/sync_29.py,sha256=YpEucAC639BWrKEcusZQUcLOzvfs05SnVgq86hubOTg,5486
|
|
96
|
+
ng_bot_api/methods/sync_30.py,sha256=AQfZP2k9bBvRqUnqUd2UrDp8DwyEa6X1hdXkCxm_VgE,5358
|
|
97
|
+
ng_bot_api/methods/sync_31.py,sha256=7fzw3CApvmN3x-XcxxHi-mkyxInXr114dZqIUNl6OrE,7476
|
|
98
|
+
ng_bot_api/methods/sync_32.py,sha256=yKQsf9r8mnwbYM2b5tNvdG2VY0GCLCZSvfe2ro65rlA,7400
|
|
99
|
+
ng_bot_api/methods/sync_33.py,sha256=WLKBrtrnz6fzM4Jk_rm-aMMD9DbTmfNwujFcaVIOkiw,5456
|
|
100
|
+
ng_bot_api/methods/sync_34.py,sha256=MiatUHHATk6cIqfcHKSiJ0FT_Wj-Nzv04QvuQAy--Pk,6057
|
|
101
|
+
ng_bot_api/methods/sync_35.py,sha256=gUCarszjsONyT6t4HWohCLRLPeuZF8H8RVrvfmms8K8,7284
|
|
102
|
+
ng_bot_api/methods/sync_36.py,sha256=o6yNKnSs-jantMeGQDjGpCg_OAZyU8GONEpKbKxyG9I,5231
|
|
103
|
+
ng_bot_api/methods/sync_37.py,sha256=AOk-8om0rUaIkf5_uEzLltkKFjXbJNAu9dQQ0pLW7Sc,5852
|
|
104
|
+
ng_bot_api/methods/sync_38.py,sha256=jZApeswVbHbhmp6n8w-Vh-JB68uZBpEhj4LfUptJ92c,7157
|
|
105
|
+
ng_bot_api/methods/sync_39.py,sha256=XCwjlzDUVIaeSn6eb0NfEbnQ0VE7diCTmlXYMkBEwH0,6812
|
|
106
|
+
ng_bot_api/methods/sync_40.py,sha256=7RPO2N9VA24AGAmkVAoQuh_s6UgixUgCeEYCO-m9rO0,8520
|
|
107
|
+
ng_bot_api/methods/sync_41.py,sha256=3Zfp4A_PX--vNOfyrc5qxGV-gHq7Pk65bhzJCm4TwMI,6254
|
|
108
|
+
ng_bot_api/methods/sync_42.py,sha256=nH6ySegGKVfYjOruV9Vd0U0wHeMr44XB1TFggc4c_y0,1380
|
|
109
|
+
ng_bot_api/types/__init__.py,sha256=DJSMuJrhDd5oFSUbeKU3ylTKG29my8hoWCmxawSCeng,2612
|
|
110
|
+
ng_bot_api/types/available_types_01.py,sha256=2SWwnYdWYirhbKsCJkuy-1mAKKxLTFlxbl7n_rZ4LHU,4729
|
|
111
|
+
ng_bot_api/types/available_types_02.py,sha256=LQtnSIdf4eIgCHLdKw29CPrjjm1Z-XrMCU6BPAgUe1c,9483
|
|
112
|
+
ng_bot_api/types/available_types_03.py,sha256=P_rCfEZWHsKF9WyO7nDwtT-z6KXwrsFD7sfl5cULOto,22222
|
|
113
|
+
ng_bot_api/types/available_types_04.py,sha256=kYAsHzN-rdw2COkRne_asXZee7S5CkdAHMJnoXzFT8s,4977
|
|
114
|
+
ng_bot_api/types/available_types_05.py,sha256=l5g9pQTrzLs4yo9qrFlOoWrIwWUyCKD6zQ5jaBcnqOA,10279
|
|
115
|
+
ng_bot_api/types/available_types_06.py,sha256=RpkeS1hpKWH69SBnY44h2cqmjv2ByGNKMPakh08G06s,4421
|
|
116
|
+
ng_bot_api/types/available_types_07.py,sha256=QeNDspIfl1jmDG773Ex6I580rvOyml1BE5UP6WnzoI8,5332
|
|
117
|
+
ng_bot_api/types/available_types_08.py,sha256=zt07iUBMYt21tj3SIb_HTsnh7njKIPkHhELXFDWInSQ,5062
|
|
118
|
+
ng_bot_api/types/available_types_09.py,sha256=R4tmS7NNyQPT9o5DDlDBHEqmWu-EdKWhipP9vdkX-p4,3318
|
|
119
|
+
ng_bot_api/types/available_types_10.py,sha256=0zKn2PFVexEmhoyj5c-Kapb67wRlUP7mkVO5nd0IkxE,4791
|
|
120
|
+
ng_bot_api/types/available_types_11.py,sha256=JzuUQff0zbAYTPf77g-dCwZlQfswuq6ME59Ll_K8CZ8,5587
|
|
121
|
+
ng_bot_api/types/available_types_12.py,sha256=VUjXIY_d_9azZLVpt-QDqXCK5z58z9S5ikHLe3hFbXA,4542
|
|
122
|
+
ng_bot_api/types/available_types_13.py,sha256=_pURivMXM5imy7Kqp7cw5rGsrhhVFw5fBMr3F6fneNU,4608
|
|
123
|
+
ng_bot_api/types/available_types_14.py,sha256=L2u77IcrePBC-dH3SnPXA9DQXlArnTx-g_EOWQtmCLk,4294
|
|
124
|
+
ng_bot_api/types/available_types_15.py,sha256=DfVHPexBuFrOA-DCn-AtcAFl5rxHzVcLGCVp0i98xzQ,4674
|
|
125
|
+
ng_bot_api/types/available_types_16.py,sha256=cVyT1kr4paq4g8gL5T9FShZtrqISKncA5jhuHL4siEc,5618
|
|
126
|
+
ng_bot_api/types/available_types_17.py,sha256=Cw7niDRe49MokIhb7jd5VSSAWuMIWuBYymMZOoij0po,5395
|
|
127
|
+
ng_bot_api/types/available_types_18.py,sha256=M4-8sAC_HuBO3ks70Bn8tKs_I52tcO5VPu4GejWN2N0,5840
|
|
128
|
+
ng_bot_api/types/available_types_19.py,sha256=oslcp6jSQOuqL9_XkVi50c9RjQcxbViEsZiYLmutoKE,4977
|
|
129
|
+
ng_bot_api/types/available_types_20.py,sha256=Un9HsUrYa1VRxIAp_wP-y2YwGMMzQFF2o6-VwspM4u8,8352
|
|
130
|
+
ng_bot_api/types/available_types_21.py,sha256=pgr5wSS0fIF6zSEVtaKdDvrogTn7s2RrreIgshi-Qvc,6426
|
|
131
|
+
ng_bot_api/types/available_types_22.py,sha256=zqWRkNJ4q8KXynZ9aabm69tAoClKPURN64FcmGHqyBI,7488
|
|
132
|
+
ng_bot_api/types/available_types_23.py,sha256=JbGYpczIh_NP55vbHawyY9n7gkSEUGOx-5_jhFbgz1s,5941
|
|
133
|
+
ng_bot_api/types/available_types_24.py,sha256=PjHiQANpYUpP6Lmz2W-wQWkkoDz4enkCZEPSbkHNby8,5160
|
|
134
|
+
ng_bot_api/types/available_types_25.py,sha256=PAB5KSejcj56Lyg2jfT8W46pNpnipDU0s9ifcZvY--A,4983
|
|
135
|
+
ng_bot_api/types/available_types_26.py,sha256=OhC6OnoacgEExqG-uu1Z4rn3FWLDNQ2WmrT9Xzx_qxI,4109
|
|
136
|
+
ng_bot_api/types/available_types_27.py,sha256=MNQdAB8L3wlhp15IOmE7PoZ2ffrqtgSTz6cQqiFb2_M,4936
|
|
137
|
+
ng_bot_api/types/available_types_28.py,sha256=y6ZWVPOTxIZieFb1F6o_u78QdNzAzCSgujVFG44KQ2I,5021
|
|
138
|
+
ng_bot_api/types/available_types_29.py,sha256=hKaUrt9xmT0O-VQW3CYRgwXBzTP3ceH_kN-vnOJrn48,4136
|
|
139
|
+
ng_bot_api/types/available_types_30.py,sha256=vqmRismNrIZJLq1neEMBzZoIZ_xO3_0xPvnB09AFgas,3456
|
|
140
|
+
ng_bot_api/types/available_types_31.py,sha256=1oY7Y0nQrwwrv29X0vflm_cF8H4FQ7i6XNtdBWMRE7g,3768
|
|
141
|
+
ng_bot_api/types/available_types_32.py,sha256=SQ3l8Wq5exQB0qPJ4yYZ-uGts6mUiOFKLKdUcAFnIc8,4395
|
|
142
|
+
ng_bot_api/types/available_types_33.py,sha256=OIM2QGHf0_7IusecvbO84qDLiTxWfSXsAn9zeT5fucs,4428
|
|
143
|
+
ng_bot_api/types/available_types_34.py,sha256=Zv82nbdo0sa3_s8D7mQ5YB_TLmiBVoeED1vtuYBurEs,4909
|
|
144
|
+
ng_bot_api/types/available_types_35.py,sha256=f4Bc63sgHiSJvmCn_lbHMg06KAJ4eUevw5q1VK9FUJE,6467
|
|
145
|
+
ng_bot_api/types/available_types_36.py,sha256=uGB8GTH3NFvonqzO2AsmiiKjhFT7OjPm9hWE84ZzeeU,4003
|
|
146
|
+
ng_bot_api/types/available_types_37.py,sha256=gg-yssP6OXwOMZpTBnFWZJdm8WYIEGc7-dKsqxmNuMo,4101
|
|
147
|
+
ng_bot_api/types/available_types_38.py,sha256=XCM49IaN7lvI085rq_gCiIgavMua6FO1lO9TNpPj6SE,4186
|
|
148
|
+
ng_bot_api/types/available_types_39.py,sha256=PWaEY6SltpCSvDH8UkDLsa-IifQ3fV-eVRGMEncH75E,5152
|
|
149
|
+
ng_bot_api/types/available_types_40.py,sha256=gtapGqjqBW4pBM6NzZeYXtzXnWR0zhUAtywFwSl464s,6223
|
|
150
|
+
ng_bot_api/types/available_types_41.py,sha256=dJRCCs3KJFL8H8Xz8JELkGN_eh5WY0r-Ps3JByVB_zM,6047
|
|
151
|
+
ng_bot_api/types/available_types_42.py,sha256=kzIwL3RUbgJ86o7cvwqoeeohLSyHd8Ah13wOniYOAXg,5948
|
|
152
|
+
ng_bot_api/types/available_types_43.py,sha256=qN477tvkZs1vuDKTBYGG_LkBYggSYsvi1pMQpsJQ6ac,5976
|
|
153
|
+
ng_bot_api/types/available_types_44.py,sha256=7ROveyRQD0lQSxRt33jYlOfppE2Gs_AzzfDLv3lS-rE,1328
|
|
154
|
+
ng_bot_api/types/games_01.py,sha256=ZtiHlnINx4KifkHdIthQPTOL02Fvr8Ozg0DcioDGTGc,1943
|
|
155
|
+
ng_bot_api/types/getting_updates_01.py,sha256=xtvSevC1a_A1R-NZH3CfgQitx2b7IKp7yScWdu_y9XA,8623
|
|
156
|
+
ng_bot_api/types/inline_mode_01.py,sha256=XTasiTucDjOj7tev5QLrpolBqR0wxYbqewB3e0FTgpw,5962
|
|
157
|
+
ng_bot_api/types/inline_mode_02.py,sha256=h5bBYP4FuQRUsifdkn4qYA9XhsGgaQrmB9KJOPDXPuM,4477
|
|
158
|
+
ng_bot_api/types/inline_mode_03.py,sha256=ElGDU2aGX5mZGyu7EpQKxA5bW49HGXibEaR9Yog0RaU,5526
|
|
159
|
+
ng_bot_api/types/inline_mode_04.py,sha256=FSaR56zFLBCI9M5OqmtQwRUPxHsgmpKet1-pI2ZZUcw,5887
|
|
160
|
+
ng_bot_api/types/inline_mode_05.py,sha256=M7tvmjHWNVLav3zkgYXW7JmkQUn9kskgr7KD8IWQYnY,5396
|
|
161
|
+
ng_bot_api/types/inline_mode_06.py,sha256=B-S_i9ECGaOrugUBroz-JxPsSW8o_-W8E_PnrS59b2s,6030
|
|
162
|
+
ng_bot_api/types/inline_mode_07.py,sha256=YCKKF-dR9zJI9QXPpvtbJ1GeVTEUBCczoqO7SB3HUbg,5506
|
|
163
|
+
ng_bot_api/types/inline_mode_08.py,sha256=9bXusRLDveNKWlEgsnwgatz1Uamoh-S6KGgmZ3yD60w,5532
|
|
164
|
+
ng_bot_api/types/inline_mode_09.py,sha256=etnaiRVdIEaZ3pT3DDIvAJpmOzfrR2pDVipwsBlwxeA,4846
|
|
165
|
+
ng_bot_api/types/payments_01.py,sha256=4iRI_Gw-nA0a291jNKE8bXQGmOHqoUOERagVvedR1Jw,4576
|
|
166
|
+
ng_bot_api/types/payments_02.py,sha256=LdxwsHB66oYeJphTZP5dQ2SnJB1ngnF6MlhHTaM413w,4323
|
|
167
|
+
ng_bot_api/types/payments_03.py,sha256=4fX91YGqf2O5Mx06m4KOGftcjMvPClotNGeK6vkfE3Q,5372
|
|
168
|
+
ng_bot_api/types/payments_04.py,sha256=cSYgPwXyfRW8N287UL8gTbb0M289AVZH-y39tITVv9k,2779
|
|
169
|
+
ng_bot_api/types/rich_messages_01.py,sha256=zsZN9-4epL83kS0owhCpXx0pOuCSsG5jgtDfHqB4nbw,6899
|
|
170
|
+
ng_bot_api/types/rich_messages_02.py,sha256=qUm3GRQufCr12CrN8UWj7K_N8KimYe17tGajXDR7HPY,3067
|
|
171
|
+
ng_bot_api/types/rich_messages_03.py,sha256=5xGLai7z8cR9UCanmBpGjZvEY2o8saoQQbsFNmKRkUU,2913
|
|
172
|
+
ng_bot_api/types/rich_messages_04.py,sha256=UYrH_2aUXdfl-9V5e8tHSCANBIKFc7quheMMELDVqxQ,2621
|
|
173
|
+
ng_bot_api/types/rich_messages_05.py,sha256=8-EnpnHm2WsgjcpFFGpywfUzJ0nF3Fnw0IRcJythg-Y,3921
|
|
174
|
+
ng_bot_api/types/rich_messages_06.py,sha256=O3nFoCVZUNBQI3maUb5tm_yC6NhTEgjzD0j4nJOojMQ,3624
|
|
175
|
+
ng_bot_api/types/rich_messages_07.py,sha256=QIi0gwwfOvYIoWW5rJkN3zWTEzQekSGbFXPL2csyLj0,3527
|
|
176
|
+
ng_bot_api/types/rich_messages_08.py,sha256=bOp93Vg8Kvgb2Z4AaSimCeO6n_qFlCAiQMwEqVfwvVk,3607
|
|
177
|
+
ng_bot_api/types/rich_messages_09.py,sha256=wOcfziF9KvXFqAna1zvAzzuAo3OZUiXNeLhA7nCfyYk,4278
|
|
178
|
+
ng_bot_api/types/rich_messages_10.py,sha256=JjZYW4CulA5lCO9Jf7ho2PN7__NXeRZ3-EAt0ulQXs8,3827
|
|
179
|
+
ng_bot_api/types/rich_messages_11.py,sha256=P7w8MoclBJK-FO2lpSTkmqJQ6AwORZVxhxi5O9Zgk2o,4076
|
|
180
|
+
ng_bot_api/types/rich_messages_12.py,sha256=bba-O8MqKJpg6F-Q-nTfmcqCYMYNhStCbJPWP9dTvSw,4112
|
|
181
|
+
ng_bot_api/types/stickers_01.py,sha256=y0VA5CkqwLVYu1EVXncHW_2pxDT0JdoJQEnZecz7o1o,4932
|
|
182
|
+
ng_bot_api/types/telegram_passport_01.py,sha256=6za6rFF6QpE0puXEwE5mhX6G1ICFBiq_7o-vWKV_UJs,6705
|
|
183
|
+
ng_bot_api/types/telegram_passport_02.py,sha256=CBwPUlZHdXZ3hZEfNHEzHyw3flMSOUPtuUROrMczDYg,4685
|
|
184
|
+
ng_bot_api/types/telegram_passport_03.py,sha256=h9SSI6-jrW8PFRyPOJpLHHOpfDBn6GYTPU3r0BRKxyw,700
|
|
185
|
+
ng_bot_api/types/unions_01.py,sha256=tGlg8Etv9xLBbcM-5-5jEc5Te-k_OafGf-3jukXZ_7M,5968
|
|
186
|
+
ng_bot_api/types/unions_02.py,sha256=AD29SSKVq3J2v78NZKELau2ej4kdIqAttL7cs8E_6cg,5769
|
|
187
|
+
ng_bot_api/types/unions_03.py,sha256=x2z3TJb_LEwWAZfpH_4QwyEDA3R1Wc8gYurYVBIChXA,6420
|
|
188
|
+
ng_bot_api/types/unions_04.py,sha256=qopaTt0qSVwpw1slYl85aQQ7gxzfFUrauo3GAYciwrY,9277
|
|
189
|
+
ng_bot_api/types/unions_05.py,sha256=q5Q2UGBU2vWmTyDzIzoxftVqJdhQ5u_zKyKLHqbTs9c,5095
|
|
190
|
+
ng_bot_api-0.1.0.dist-info/METADATA,sha256=QjJVQxfNcOoFA2dQQuTmyl-TqvZDbMG6pGSNubuQ-Fg,6868
|
|
191
|
+
ng_bot_api-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
192
|
+
ng_bot_api-0.1.0.dist-info/licenses/LICENSE,sha256=VeHVmi75rpPK99XLvzYCZQIwy-OgUe9nPtZg5UIKKQg,1064
|
|
193
|
+
ng_bot_api-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 NetGram
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|