baleio 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.
- baleio/__init__.py +93 -0
- baleio/__meta__.py +2 -0
- baleio/client/__init__.py +5 -0
- baleio/client/bot.py +655 -0
- baleio/client/default.py +18 -0
- baleio/client/session/__init__.py +4 -0
- baleio/client/session/aiohttp.py +115 -0
- baleio/client/session/base.py +178 -0
- baleio/dispatcher/__init__.py +4 -0
- baleio/dispatcher/dispatcher.py +223 -0
- baleio/dispatcher/event/__init__.py +4 -0
- baleio/dispatcher/event/handler.py +23 -0
- baleio/dispatcher/event/observer.py +74 -0
- baleio/dispatcher/router.py +72 -0
- baleio/enums/__init__.py +128 -0
- baleio/exceptions.py +121 -0
- baleio/filters/__init__.py +30 -0
- baleio/filters/base.py +81 -0
- baleio/filters/callback_data.py +149 -0
- baleio/filters/command.py +96 -0
- baleio/filters/exception.py +40 -0
- baleio/filters/logic.py +41 -0
- baleio/filters/state.py +32 -0
- baleio/fsm/__init__.py +14 -0
- baleio/fsm/context.py +33 -0
- baleio/fsm/state.py +81 -0
- baleio/fsm/storage/__init__.py +4 -0
- baleio/fsm/storage/base.py +53 -0
- baleio/fsm/storage/memory.py +39 -0
- baleio/types/__init__.py +143 -0
- baleio/types/attachments.py +53 -0
- baleio/types/base.py +84 -0
- baleio/types/callback.py +41 -0
- baleio/types/chat.py +135 -0
- baleio/types/error.py +20 -0
- baleio/types/input_file.py +115 -0
- baleio/types/input_media.py +58 -0
- baleio/types/keyboards.py +59 -0
- baleio/types/media.py +98 -0
- baleio/types/message.py +272 -0
- baleio/types/misc.py +18 -0
- baleio/types/payments.py +50 -0
- baleio/types/update.py +33 -0
- baleio/types/user.py +27 -0
- baleio/utils/__init__.py +3 -0
- baleio/utils/call.py +77 -0
- baleio/utils/keyboard.py +84 -0
- baleio/utils/markdown.py +35 -0
- baleio-0.1.0.dist-info/METADATA +389 -0
- baleio-0.1.0.dist-info/RECORD +52 -0
- baleio-0.1.0.dist-info/WHEEL +4 -0
- baleio-0.1.0.dist-info/licenses/LICENSE +21 -0
baleio/__init__.py
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"""baleio — a modern, fully async framework for Bale (بله) bots.
|
|
2
|
+
|
|
3
|
+
Inspired by aiogram. Quick start::
|
|
4
|
+
|
|
5
|
+
import asyncio
|
|
6
|
+
from baleio import Bot, Dispatcher
|
|
7
|
+
from baleio.filters import Command
|
|
8
|
+
from baleio.types import Message
|
|
9
|
+
|
|
10
|
+
dp = Dispatcher()
|
|
11
|
+
|
|
12
|
+
@dp.message(Command("start"))
|
|
13
|
+
async def start(message: Message):
|
|
14
|
+
await message.answer("سلام! به baleio خوش اومدی.")
|
|
15
|
+
|
|
16
|
+
async def main():
|
|
17
|
+
bot = Bot("TOKEN")
|
|
18
|
+
await dp.start_polling(bot)
|
|
19
|
+
|
|
20
|
+
asyncio.run(main())
|
|
21
|
+
"""
|
|
22
|
+
from __future__ import annotations
|
|
23
|
+
|
|
24
|
+
from . import enums, filters, types
|
|
25
|
+
from .__meta__ import __version__
|
|
26
|
+
from .client import AiohttpSession, BaseSession, Bot, DefaultBotProperties
|
|
27
|
+
from .dispatcher import Dispatcher, Router
|
|
28
|
+
from .exceptions import (
|
|
29
|
+
BaleAPIError,
|
|
30
|
+
BaleBadRequest,
|
|
31
|
+
BaleError,
|
|
32
|
+
BaleForbidden,
|
|
33
|
+
BaleNetworkError,
|
|
34
|
+
BaleNotFound,
|
|
35
|
+
BaleRetryAfter,
|
|
36
|
+
BaleUnauthorized,
|
|
37
|
+
)
|
|
38
|
+
from .filters import (
|
|
39
|
+
CallbackData,
|
|
40
|
+
Command,
|
|
41
|
+
CommandStart,
|
|
42
|
+
ExceptionTypeFilter,
|
|
43
|
+
F,
|
|
44
|
+
StateFilter,
|
|
45
|
+
)
|
|
46
|
+
from .fsm import FSMContext, MemoryStorage, State, StatesGroup
|
|
47
|
+
from .utils import InlineKeyboardBuilder, ReplyKeyboardBuilder
|
|
48
|
+
from .utils import markdown as md
|
|
49
|
+
|
|
50
|
+
#: Bale renders Markdown only, so ``md`` is the analogue of aiogram's ``html``.
|
|
51
|
+
markdown = md
|
|
52
|
+
|
|
53
|
+
__all__ = [
|
|
54
|
+
"__version__",
|
|
55
|
+
# sub-packages
|
|
56
|
+
"types",
|
|
57
|
+
"enums",
|
|
58
|
+
"filters",
|
|
59
|
+
"md",
|
|
60
|
+
"markdown",
|
|
61
|
+
# client
|
|
62
|
+
"Bot",
|
|
63
|
+
"DefaultBotProperties",
|
|
64
|
+
"AiohttpSession",
|
|
65
|
+
"BaseSession",
|
|
66
|
+
# dispatcher
|
|
67
|
+
"Dispatcher",
|
|
68
|
+
"Router",
|
|
69
|
+
# filters
|
|
70
|
+
"F",
|
|
71
|
+
"Command",
|
|
72
|
+
"CommandStart",
|
|
73
|
+
"StateFilter",
|
|
74
|
+
"CallbackData",
|
|
75
|
+
"ExceptionTypeFilter",
|
|
76
|
+
# fsm
|
|
77
|
+
"FSMContext",
|
|
78
|
+
"State",
|
|
79
|
+
"StatesGroup",
|
|
80
|
+
"MemoryStorage",
|
|
81
|
+
# keyboards
|
|
82
|
+
"InlineKeyboardBuilder",
|
|
83
|
+
"ReplyKeyboardBuilder",
|
|
84
|
+
# exceptions
|
|
85
|
+
"BaleError",
|
|
86
|
+
"BaleAPIError",
|
|
87
|
+
"BaleBadRequest",
|
|
88
|
+
"BaleForbidden",
|
|
89
|
+
"BaleNotFound",
|
|
90
|
+
"BaleUnauthorized",
|
|
91
|
+
"BaleNetworkError",
|
|
92
|
+
"BaleRetryAfter",
|
|
93
|
+
]
|
baleio/__meta__.py
ADDED