mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-09 01:15:31 +00:00
Typo 'pooling' -> 'polling'.
This commit is contained in:
parent
233acab68e
commit
ef3b59c63c
10 changed files with 74 additions and 65 deletions
|
|
@ -10,7 +10,7 @@ Provided to start bot with webhook:
|
|||
--host-name example.com \
|
||||
--webhook-port 443
|
||||
|
||||
Or long pooling:
|
||||
Or long polling:
|
||||
python adwanced_executor_example.py --token TOKEN_HERE
|
||||
|
||||
So... In this example found small trouble:
|
||||
|
|
@ -29,7 +29,7 @@ import sys
|
|||
from aiogram import Bot
|
||||
from aiogram.dispatcher import Dispatcher
|
||||
from aiogram.dispatcher.webhook import *
|
||||
from aiogram.utils.executor import start_pooling, start_webhook
|
||||
from aiogram.utils.executor import start_polling, start_webhook
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ def main(arguments):
|
|||
on_shutdown=on_shutdown,
|
||||
host=host, port=port, path=sock, ssl_context=ssl_context)
|
||||
else:
|
||||
start_pooling(dispatcher, on_startup=on_startup, on_shutdown=on_shutdown)
|
||||
start_polling(dispatcher, on_startup=on_startup, on_shutdown=on_shutdown)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import logging
|
|||
from aiogram import Bot, types
|
||||
from aiogram.dispatcher import Dispatcher
|
||||
from aiogram.types import ParseMode
|
||||
from aiogram.utils.executor import start_pooling
|
||||
from aiogram.utils.executor import start_polling
|
||||
from aiogram.utils.markdown import *
|
||||
|
||||
API_TOKEN = 'BOT TOKEN HERE'
|
||||
|
|
@ -33,11 +33,5 @@ async def check_language(message: types.Message):
|
|||
sep='\n'), parse_mode=ParseMode.MARKDOWN)
|
||||
|
||||
|
||||
async def main():
|
||||
count = await dp.skip_updates()
|
||||
print(f"Skipped {count} updates.")
|
||||
await dp.start_pooling()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
start_pooling(dp, loop=loop, skip_updates=True)
|
||||
start_polling(dp, loop=loop, skip_updates=True)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import logging
|
|||
|
||||
from aiogram import Bot, types
|
||||
from aiogram.dispatcher import Dispatcher
|
||||
from aiogram.utils.executor import start_pooling
|
||||
from aiogram.utils.executor import start_polling
|
||||
|
||||
API_TOKEN = 'BOT TOKEN HERE'
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ async def echo(message: types.Message):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
start_pooling(dp, loop=loop, skip_updates=True)
|
||||
start_polling(dp, loop=loop, skip_updates=True)
|
||||
|
||||
# Also you can use another execution method
|
||||
# >>> try:
|
||||
|
|
|
|||
|
|
@ -128,4 +128,4 @@ async def shutdown(dispatcher: Dispatcher):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
executor.start_pooling(dp, loop=loop, skip_updates=True, on_shutdown=shutdown)
|
||||
executor.start_polling(dp, loop=loop, skip_updates=True, on_shutdown=shutdown)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import logging
|
|||
|
||||
from aiogram import Bot, types
|
||||
from aiogram.dispatcher import Dispatcher
|
||||
from aiogram.utils.executor import start_pooling
|
||||
from aiogram.utils.executor import start_polling
|
||||
|
||||
API_TOKEN = 'BOT TOKEN HERE'
|
||||
|
||||
|
|
@ -22,4 +22,4 @@ async def inline_echo(inline_query: types.InlineQuery):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
start_pooling(dp, loop=loop, skip_updates=True)
|
||||
start_polling(dp, loop=loop, skip_updates=True)
|
||||
|
|
|
|||
|
|
@ -95,4 +95,4 @@ async def got_payment(message: types.Message):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
executor.start_pooling(dp, loop=loop)
|
||||
executor.start_polling(dp, loop=loop)
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
import asyncio
|
||||
import logging
|
||||
|
||||
import aiohttp
|
||||
|
||||
from aiogram import Bot, types
|
||||
from aiogram.dispatcher import Dispatcher
|
||||
from aiogram.types import ParseMode
|
||||
from aiogram.utils.emoji import emojize
|
||||
from aiogram.utils.executor import start_pooling
|
||||
from aiogram.utils.markdown import text, bold, italic, code
|
||||
from aiogram.utils.executor import start_polling
|
||||
from aiogram.utils.markdown import bold, code, italic, text
|
||||
|
||||
# Configure bot here
|
||||
API_TOKEN = 'BOT TOKEN HERE'
|
||||
|
|
@ -60,11 +58,5 @@ async def cmd_start(message: types.Message):
|
|||
# For example emojize('Moon face :new_moon_face:') is represents to 'Moon face 🌚'
|
||||
|
||||
|
||||
async def main():
|
||||
count = await dp.skip_updates()
|
||||
print(f"Skipped {count} updates.")
|
||||
await dp.start_pooling()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
start_pooling(dp, loop=loop, skip_updates=True)
|
||||
start_polling(dp, loop=loop, skip_updates=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue