Dev 3.x flat package (#961)

* Move packages

* Added changelog

* Update examples/echo_bot.py

Co-authored-by: Oleg A. <t0rr@mail.ru>

* Rename `handler` -> `handlers`

* Update __init__.py

Co-authored-by: Oleg A. <t0rr@mail.ru>
This commit is contained in:
Alex Root Junior 2022-08-14 01:07:52 +03:00 committed by GitHub
parent 5e7932ca20
commit 4315ecf1a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
111 changed files with 376 additions and 390 deletions

View file

@ -14,10 +14,11 @@ async def command_start_handler(message: Message) -> None:
"""
This handler receive messages with `/start` command
"""
# Most of event objects has an aliases for API methods to be called in event context
# Most event objects have aliases for API methods that can be called in events' context
# For example if you want to answer to incoming message you can use `message.answer(...)` alias
# and the target chat will be passed to :ref:`aiogram.methods.send_message.SendMessage` method automatically
# or call API method directly via Bot instance: `bot.send_message(chat_id=message.chat.id, ...)`
# and the target chat will be passed to :ref:`aiogram.methods.send_message.SendMessage`
# method automatically or call API method directly via
# Bot instance: `bot.send_message(chat_id=message.chat.id, ...)`
await message.answer(f"Hello, <b>{message.from_user.full_name}!</b>")
@ -26,7 +27,7 @@ async def echo_handler(message: types.Message) -> None:
"""
Handler will forward received message back to the sender
By default message handler will handle all message types (like text, photo, sticker and etc.)
By default, message handler will handle all message types (like text, photo, sticker and etc.)
"""
try:
# Send copy of the received message

View file

@ -5,8 +5,8 @@ from os import getenv
from typing import Any, Dict
from aiogram import Bot, Dispatcher, F, Router, html
from aiogram.dispatcher.fsm.context import FSMContext
from aiogram.dispatcher.fsm.state import State, StatesGroup
from aiogram.fsm.context import FSMContext
from aiogram.fsm.state import State, StatesGroup
from aiogram.types import KeyboardButton, Message, ReplyKeyboardMarkup, ReplyKeyboardRemove
form_router = Router()

View file

@ -6,16 +6,16 @@ from finite_state_machine import form_router
from aiogram import Bot, Dispatcher, F, Router
from aiogram.client.session.aiohttp import AiohttpSession
from aiogram.dispatcher.filters import Command, CommandObject
from aiogram.dispatcher.fsm.storage.redis import DefaultKeyBuilder, RedisStorage
from aiogram.dispatcher.webhook.aiohttp_server import (
from aiogram.exceptions import TelegramUnauthorizedError
from aiogram.filters import Command, CommandObject
from aiogram.fsm.storage.redis import DefaultKeyBuilder, RedisStorage
from aiogram.types import Message
from aiogram.utils.token import TokenValidationError, validate_token
from aiogram.webhook.aiohttp_server import (
SimpleRequestHandler,
TokenBasedRequestHandler,
setup_application,
)
from aiogram.exceptions import TelegramUnauthorizedError
from aiogram.types import Message
from aiogram.utils.token import TokenValidationError, validate_token
main_router = Router()

View file

@ -1,10 +1,13 @@
import logging
from aiogram import Bot, Dispatcher
from aiogram.dispatcher.router import Router
from aiogram.types import CallbackQuery, ChatMemberUpdated, Message
from aiogram.types.inline_keyboard_button import InlineKeyboardButton
from aiogram.types.inline_keyboard_markup import InlineKeyboardMarkup
from aiogram import Bot, Dispatcher, Router
from aiogram.types import (
CallbackQuery,
ChatMemberUpdated,
InlineKeyboardButton,
InlineKeyboardMarkup,
Message,
)
TOKEN = "6wo"
dp = Dispatcher()

View file

@ -1,5 +1,5 @@
from aiogram import Bot, F, Router
from aiogram.dispatcher.filters import Command
from aiogram.filters import Command
from aiogram.types import (
InlineKeyboardButton,
InlineKeyboardMarkup,

View file

@ -7,8 +7,8 @@ from handlers import my_router
from routes import check_data_handler, demo_handler, send_message_handler
from aiogram import Bot, Dispatcher
from aiogram.dispatcher.webhook.aiohttp_server import SimpleRequestHandler, setup_application
from aiogram.types import MenuButtonWebApp, WebAppInfo
from aiogram.webhook.aiohttp_server import SimpleRequestHandler, setup_application
TELEGRAM_TOKEN = getenv("TELEGRAM_TOKEN")
APP_BASE_URL = getenv("APP_BASE_URL")