This commit is contained in:
hhh
2025-01-02 22:19:43 +02:00
commit 9e29d01f1d
28 changed files with 1171 additions and 0 deletions

11
bot/handlers/__init__.py Normal file
View File

@@ -0,0 +1,11 @@
from aiogram import Router
from bot.middlewares import LikeMiddleware
from . import initialize, on_1686, start, inline
router = Router()
router.message.middleware(LikeMiddleware())
router.include_routers(initialize.router, start.router, on_1686.router, inline.router)

View File

@@ -0,0 +1,3 @@
from .initializer import router
__all__ = ["router"]

View File

@@ -0,0 +1,9 @@
from aiogram import Bot, Router
from rich import print
router = Router()
@router.startup()
async def startup(bot: Bot):
print(f"[green]Started as[/] @{(await bot.me()).username}")

View File

@@ -0,0 +1,4 @@
from .on_inline import router
__all__ = ["router"]

View File

@@ -0,0 +1,20 @@
from aiogram import Router
from aiogram.types import InlineQuery
from aiogram.types import InlineQueryResultCachedVoice
from ...utils.config import config
router = Router()
@router.inline_query()
async def default_inline_query(inline_query: InlineQuery):
await inline_query.answer(
[
InlineQueryResultCachedVoice(
id=id_[-1:-8:-1], voice_file_id=id_, title=config.send[id_]
)
for id_ in config.send.keys()
]
)

View File

@@ -0,0 +1,3 @@
from .h1686 import router
__all__ = ["router"]

View File

@@ -0,0 +1,16 @@
from aiogram import Router, types
from ...filters import Filter1686, FilterBusiness1686
from ...utils.config import config
router = Router()
@router.message(Filter1686())
async def on_message(message: types.Message):
await message.reply_voice(list(config.send.keys())[0])
@router.business_message(FilterBusiness1686())
async def on_business_message(business_message: types.Message):
await business_message.reply_voice(list(config.send.keys())[0])

View File

@@ -0,0 +1,3 @@
from .start import router
__all__ = ["router"]

View File

@@ -0,0 +1,9 @@
from aiogram import Router, types
from aiogram.filters import Command
router = Router()
@router.message(Command("start"))
async def on_start(message: types.Message):
await message.reply(text="1686")