forked from Pavel_Durov/python_bot
вывод времени
This commit is contained in:
parent
1f1e47c912
commit
0e53b0d234
9
bot.py
9
bot.py
@ -1,6 +1,6 @@
|
||||
from cgitb import text
|
||||
import time
|
||||
from datetime import datetime
|
||||
import datetime
|
||||
date = datetime
|
||||
import logging
|
||||
|
||||
@ -14,11 +14,12 @@ logging.basicConfig(level=logging.DEBUG)
|
||||
bot = Bot(token=API_TOKEN)
|
||||
dp = Dispatcher(bot)
|
||||
|
||||
current_time = datetime.datetime.now()
|
||||
|
||||
@dp.message_handler(commands=time)
|
||||
@dp.message_handler(commands=["time"])
|
||||
async def send_time(message: types.Message):
|
||||
await message.reply(print(current_time)) #отображение времени, пока не рабоатет
|
||||
current_time = datetime.now()
|
||||
await message.reply(current_time) #отображение времени, пока не рабоатет
|
||||
|
||||
|
||||
""""async def set_default_commands(dp):
|
||||
await dp.bot.set_my_commands([
|
||||
|
Loading…
Reference in New Issue
Block a user