mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Update README.md (#586)
This commit is contained in:
parent
405add31ab
commit
0e28756a10
1 changed files with 5 additions and 2 deletions
|
|
@ -29,9 +29,10 @@
|
|||
import asyncio
|
||||
from aiogram import Bot
|
||||
|
||||
BOT_TOKEN = ""
|
||||
|
||||
async def main():
|
||||
bot = Bot(token=BOT-TOKEN)
|
||||
bot = Bot(token=BOT_TOKEN)
|
||||
|
||||
try:
|
||||
me = await bot.get_me()
|
||||
|
|
@ -48,6 +49,8 @@ asyncio.run(main())
|
|||
import asyncio
|
||||
from aiogram import Bot, Dispatcher, types
|
||||
|
||||
BOT_TOKEN = ""
|
||||
|
||||
async def start_handler(event: types.Message):
|
||||
await event.answer(
|
||||
f"Hello, {event.from_user.get_mention(as_html=True)} 👋!",
|
||||
|
|
@ -55,7 +58,7 @@ async def start_handler(event: types.Message):
|
|||
)
|
||||
|
||||
async def main():
|
||||
bot = Bot(token=BOT-TOKEN)
|
||||
bot = Bot(token=BOT_TOKEN)
|
||||
try:
|
||||
disp = Dispatcher(bot=bot)
|
||||
disp.register_message_handler(start_handler, commands={"start", "restart"})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue