mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-11 01:54:53 +00:00
Merge branch 'dev-1.x' into patch-1
This commit is contained in:
commit
c73975a2df
8 changed files with 25 additions and 34 deletions
|
|
@ -8,9 +8,9 @@ At first you have to import all necessary modules
|
|||
|
||||
.. code-block:: python3
|
||||
|
||||
from aiogram import Bot, types
|
||||
from aiogram.dispatcher import Dispatcher
|
||||
from aiogram.utils import executor
|
||||
from aiogram import Bot, types
|
||||
from aiogram.dispatcher import Dispatcher
|
||||
from aiogram.utils import executor
|
||||
|
||||
Then you have to initialize bot and dispatcher instances.
|
||||
Bot token you can get from `@BotFather <https://t.me/BotFather>`_
|
||||
|
|
@ -18,8 +18,8 @@ Bot token you can get from `@BotFather <https://t.me/BotFather>`_
|
|||
|
||||
.. code-block:: python3
|
||||
|
||||
bot = Bot(token='BOT TOKEN HERE')
|
||||
dp = Dispatcher(bot)
|
||||
bot = Bot(token='BOT TOKEN HERE')
|
||||
dp = Dispatcher(bot)
|
||||
|
||||
Next step: interaction with bots starts with one command. Register your first command handler:
|
||||
|
||||
|
|
@ -41,12 +41,12 @@ Summary
|
|||
|
||||
.. code-block:: python3
|
||||
|
||||
from aiogram import Bot, types
|
||||
from aiogram.dispatcher import Dispatcher
|
||||
from aiogram.utils import executor
|
||||
from aiogram import Bot, types
|
||||
from aiogram.dispatcher import Dispatcher
|
||||
from aiogram.utils import executor
|
||||
|
||||
bot = Bot(token='BOT TOKEN HERE')
|
||||
dp = Dispatcher(bot)
|
||||
bot = Bot(token='BOT TOKEN HERE')
|
||||
dp = Dispatcher(bot)
|
||||
|
||||
@dp.message_handler(commands=['start', 'help'])
|
||||
async def send_welcome(message: types.Message):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue