Compare commits
2 Commits
732c86b6fb
...
4364c2c175
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4364c2c175 | ||
|
|
5db09d0fd1 |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 12 KiB |
@@ -3,13 +3,13 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://qbot.botforge.biz"><img src="img/qbot.svg" alt="QBot"></a>
|
<a href="https://quickbot.botforge.biz"><img src="img/qbot.svg" alt="QuickBot"></a>
|
||||||
</p>
|
</p>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<em>Telegram Bots Rapid Application Development (RAD) Framework.</em>
|
<em>Telegram Bots Rapid Application Development (RAD) Framework.</em>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
**QBot** is a library for fast development of Telegram bots and mini-apps following the **RAD (Rapid Application Development)** principle in a **declarative style**.
|
**QuickBot** is a library for fast development of Telegram bots and mini-apps following the **RAD (Rapid Application Development)** principle in a **declarative style**.
|
||||||
|
|
||||||
## Key Features
|
## Key Features
|
||||||
|
|
||||||
@@ -20,13 +20,13 @@
|
|||||||
- **Context Preservation** – Store navigation stacks and user interaction states in the database.
|
- **Context Preservation** – Store navigation stacks and user interaction states in the database.
|
||||||
- **Internationalization Support** – Localizable UI and string fields for multilingual bots.
|
- **Internationalization Support** – Localizable UI and string fields for multilingual bots.
|
||||||
|
|
||||||
**QBot** powered by **[FastAPI](https://fastapi.tiangolo.com)**, **[SQLModel](https://sqlmodel.tiangolo.com)** & **[aiogram](https://aiogram.dev)** – Leverage the full capabilities of these frameworks for high performance and flexibility.
|
**QuickBot** powered by **[FastAPI](https://fastapi.tiangolo.com)**, **[SQLModel](https://sqlmodel.tiangolo.com)** & **[aiogram](https://aiogram.dev)** – Leverage the full capabilities of these frameworks for high performance and flexibility.
|
||||||
|
|
||||||
## Benefits
|
## Benefits
|
||||||
|
|
||||||
- **Faster Development** – Automate repetitive tasks and build bots in record time.
|
- **Faster Development** – Automate repetitive tasks and build bots in record time.
|
||||||
- **Highly Modular** – Easily extend and customize functionality.
|
- **Highly Modular** – Easily extend and customize functionality.
|
||||||
- **Less Code Duplication** – Focus on core features while QBot handles the rest.
|
- **Less Code Duplication** – Focus on core features while QuickBot handles the rest.
|
||||||
- **Enterprise-Grade Structure** – Scalable, maintainable, and optimized for real-world usage.
|
- **Enterprise-Grade Structure** – Scalable, maintainable, and optimized for real-world usage.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
@@ -42,12 +42,12 @@ class AppEntity(BotEntity):
|
|||||||
)
|
)
|
||||||
|
|
||||||
name: str # entity field with default sqlmodel's FieldInfo descriptor
|
name: str # entity field with default sqlmodel's FieldInfo descriptor
|
||||||
# and default qbot's field descriptor
|
# and default quickbot's field descriptor
|
||||||
|
|
||||||
description: str | None = Field( # field with sqlmodel's descriptor
|
description: str | None = Field( # field with sqlmodel's descriptor
|
||||||
sa_type = String, index = True) # and default qbot's descriptor
|
sa_type = String, index = True) # and default quickbot's descriptor
|
||||||
|
|
||||||
age: int = EntityField( # field with qbot's descriptor
|
age: int = EntityField( # field with quickbot's descriptor
|
||||||
caption = "Age",
|
caption = "Age",
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -96,6 +96,4 @@ async def menu(context: CommandCallbackContext):
|
|||||||
```
|
```
|
||||||
## Result
|
## Result
|
||||||
|
|
||||||
<iframe width="100%" height="691" src="https://www.youtube.com/embed/ptTnoppkYfM" title="QBot Framework – The Open-Source RAD Tool for Telegram Bots" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
|
<iframe width="100%" height="691" src="https://www.youtube.com/embed/ptTnoppkYfM" title="QuickBot Framework – The Open-Source RAD Tool for Telegram Bots" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
|
||||||
|
|
||||||
forced_change_
|
|
||||||
@@ -2,7 +2,7 @@ from aiogram.types import Message, CallbackQuery
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from qbot.main import QBotApp
|
from quickbot.main import QBotApp
|
||||||
|
|
||||||
from ..context import CallbackCommand
|
from ..context import CallbackCommand
|
||||||
|
|
||||||
@@ -12,14 +12,14 @@ from ....utils.navigation import (
|
|||||||
pop_navigation_context,
|
pop_navigation_context,
|
||||||
)
|
)
|
||||||
|
|
||||||
import qbot.bot.handlers.menu.main as menu_main
|
import quickbot.bot.handlers.menu.main as menu_main
|
||||||
import qbot.bot.handlers.menu.settings as menu_settings
|
import quickbot.bot.handlers.menu.settings as menu_settings
|
||||||
import qbot.bot.handlers.menu.parameters as menu_parameters
|
import quickbot.bot.handlers.menu.parameters as menu_parameters
|
||||||
import qbot.bot.handlers.menu.language as menu_language
|
import quickbot.bot.handlers.menu.language as menu_language
|
||||||
import qbot.bot.handlers.menu.entities as menu_entities
|
import quickbot.bot.handlers.menu.entities as menu_entities
|
||||||
import qbot.bot.handlers.forms.entity_list as form_list
|
import quickbot.bot.handlers.forms.entity_list as form_list
|
||||||
import qbot.bot.handlers.forms.entity_form as form_item
|
import quickbot.bot.handlers.forms.entity_form as form_item
|
||||||
import qbot.bot.handlers.editors.main as editor
|
import quickbot.bot.handlers.editors.main as editor
|
||||||
|
|
||||||
|
|
||||||
async def route_callback(message: Message | CallbackQuery, back: bool = True, **kwargs):
|
async def route_callback(message: Message | CallbackQuery, back: bool = True, **kwargs):
|
||||||
@@ -47,7 +47,7 @@ async def route_callback(message: Message | CallbackQuery, back: bool = True, **
|
|||||||
elif context.command == CallbackCommand.FIELD_EDITOR:
|
elif context.command == CallbackCommand.FIELD_EDITOR:
|
||||||
await editor.field_editor(message, **kwargs)
|
await editor.field_editor(message, **kwargs)
|
||||||
elif context.command == CallbackCommand.USER_COMMAND:
|
elif context.command == CallbackCommand.USER_COMMAND:
|
||||||
import qbot.bot.handlers.user_handlers.main as user_handler
|
import quickbot.bot.handlers.user_handlers.main as user_handler
|
||||||
|
|
||||||
app: "QBotApp" = kwargs["app"]
|
app: "QBotApp" = kwargs["app"]
|
||||||
cmd = app.bot_commands.get(context.user_command.split("&")[0])
|
cmd = app.bot_commands.get(context.user_command.split("&")[0])
|
||||||
@@ -6,7 +6,7 @@ from aiogram.utils.keyboard import InlineKeyboardBuilder
|
|||||||
from sqlmodel.ext.asyncio.session import AsyncSession
|
from sqlmodel.ext.asyncio.session import AsyncSession
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from qbot.model.descriptors import EntityEventContext
|
from quickbot.model.descriptors import EntityEventContext
|
||||||
|
|
||||||
from ..context import ContextData, CallbackCommand
|
from ..context import ContextData, CallbackCommand
|
||||||
from ....model.user import UserBase
|
from ....model.user import UserBase
|
||||||
@@ -7,17 +7,17 @@ from ..context import ContextData, CallbackCommand
|
|||||||
from ....utils.main import get_send_message
|
from ....utils.main import get_send_message
|
||||||
from ....utils.navigation import save_navigation_context, pop_navigation_context
|
from ....utils.navigation import save_navigation_context, pop_navigation_context
|
||||||
|
|
||||||
import qbot.bot.handlers.menu.entities as entities
|
import quickbot.bot.handlers.menu.entities as entities
|
||||||
import qbot.bot.handlers.menu.settings as settings
|
import quickbot.bot.handlers.menu.settings as settings
|
||||||
import qbot.bot.handlers.menu.parameters as parameters
|
import quickbot.bot.handlers.menu.parameters as parameters
|
||||||
import qbot.bot.handlers.menu.language as language
|
import quickbot.bot.handlers.menu.language as language
|
||||||
import qbot.bot.handlers.editors.main as editor
|
import quickbot.bot.handlers.editors.main as editor
|
||||||
import qbot.bot.handlers.editors.main_callbacks as editor_callbacks
|
import quickbot.bot.handlers.editors.main_callbacks as editor_callbacks
|
||||||
import qbot.bot.handlers.forms.entity_list as entity_list
|
import quickbot.bot.handlers.forms.entity_list as entity_list
|
||||||
import qbot.bot.handlers.forms.entity_form as entity_form
|
import quickbot.bot.handlers.forms.entity_form as entity_form
|
||||||
import qbot.bot.handlers.forms.entity_form_callbacks as entity_form_callbacks
|
import quickbot.bot.handlers.forms.entity_form_callbacks as entity_form_callbacks
|
||||||
import qbot.bot.handlers.common.filtering_callbacks as filtering_callbacks
|
import quickbot.bot.handlers.common.filtering_callbacks as filtering_callbacks
|
||||||
import qbot.bot.handlers.user_handlers.main as user_handlers_main
|
import quickbot.bot.handlers.user_handlers.main as user_handlers_main
|
||||||
|
|
||||||
|
|
||||||
logger = getLogger(__name__)
|
logger = getLogger(__name__)
|
||||||
@@ -4,21 +4,21 @@ from aiogram.types import Message, CallbackQuery, InlineKeyboardButton
|
|||||||
from inspect import iscoroutinefunction
|
from inspect import iscoroutinefunction
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from qbot.utils.main import clear_state
|
from quickbot.utils.main import clear_state
|
||||||
from qbot.utils.navigation import (
|
from quickbot.utils.navigation import (
|
||||||
save_navigation_context,
|
save_navigation_context,
|
||||||
get_navigation_context,
|
get_navigation_context,
|
||||||
pop_navigation_context,
|
pop_navigation_context,
|
||||||
)
|
)
|
||||||
from qbot.bot.handlers.editors.main import field_editor
|
from quickbot.bot.handlers.editors.main import field_editor
|
||||||
from qbot.bot.handlers.common.routing import route_callback
|
from quickbot.bot.handlers.common.routing import route_callback
|
||||||
from qbot.utils.serialization import deserialize
|
from quickbot.utils.serialization import deserialize
|
||||||
from qbot.utils.main import get_send_message
|
from quickbot.utils.main import get_send_message
|
||||||
from qbot.model.descriptors import BotCommand, CommandCallbackContext
|
from quickbot.model.descriptors import BotCommand, CommandCallbackContext
|
||||||
from qbot.model.settings import Settings
|
from quickbot.model.settings import Settings
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from qbot.main import QBotApp
|
from quickbot.main import QBotApp
|
||||||
|
|
||||||
from ..context import ContextData, CallbackCommand, CommandContext
|
from ..context import ContextData, CallbackCommand, CommandContext
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
from qbot import (
|
from quickbot import (
|
||||||
QBotApp,
|
QBotApp,
|
||||||
BotEntity,
|
BotEntity,
|
||||||
Entity,
|
Entity,
|
||||||
@@ -10,9 +10,9 @@ from qbot import (
|
|||||||
ContextData,
|
ContextData,
|
||||||
CallbackCommand,
|
CallbackCommand,
|
||||||
)
|
)
|
||||||
from qbot.model.user import UserBase
|
from quickbot.model.user import UserBase
|
||||||
from qbot.model.descriptors import Filter
|
from quickbot.model.descriptors import Filter
|
||||||
from qbot.model.role import RoleBase
|
from quickbot.model.role import RoleBase
|
||||||
|
|
||||||
from aiogram.types import InlineKeyboardButton
|
from aiogram.types import InlineKeyboardButton
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|||||||
Reference in New Issue
Block a user