Update README.md (#586)

This commit is contained in:
pigeonburger 2021-05-17 20:17:48 +10:00 committed by GitHub
parent 405add31ab
commit 0e28756a10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"})