mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-08 17:13:56 +00:00
Convert tabs to spaces
This commit is contained in:
parent
e8e108ecae
commit
545d470e02
2 changed files with 22 additions and 22 deletions
|
|
@ -10,11 +10,11 @@ BUILDDIR = build
|
|||
|
||||
# Put it first so that "make" without argument is like "make help".
|
||||
help:
|
||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
.PHONY: help Makefile
|
||||
|
||||
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||
%: Makefile
|
||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
|
@ -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,39 +18,39 @@ 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:
|
||||
|
||||
.. code-block:: python3
|
||||
|
||||
@dp.message_handler(commands=['start', 'help'])
|
||||
async def send_welcome(message: types.Message):
|
||||
await message.reply("Hi!\nI'm EchoBot!\nPowered by aiogram.")
|
||||
@dp.message_handler(commands=['start', 'help'])
|
||||
async def send_welcome(message: types.Message):
|
||||
await message.reply("Hi!\nI'm EchoBot!\nPowered by aiogram.")
|
||||
|
||||
Last step: run long polling.
|
||||
|
||||
.. code-block:: python3
|
||||
|
||||
if __name__ == '__main__':
|
||||
executor.start_polling(dp)
|
||||
if __name__ == '__main__':
|
||||
executor.start_polling(dp)
|
||||
|
||||
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):
|
||||
await message.reply("Hi!\nI'm EchoBot!\nPowered by aiogram.")
|
||||
@dp.message_handler(commands=['start', 'help'])
|
||||
async def send_welcome(message: types.Message):
|
||||
await message.reply("Hi!\nI'm EchoBot!\nPowered by aiogram.")
|
||||
|
||||
if __name__ == '__main__':
|
||||
executor.start_polling(dp)
|
||||
if __name__ == '__main__':
|
||||
executor.start_polling(dp)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue