Look like I don't know how to write code, fix functions name and kfet isoweekday test
This commit is contained in:
parent
d2dcfa5824
commit
098a5b0210
1 changed files with 4 additions and 4 deletions
8
bot.py
8
bot.py
|
@ -106,7 +106,7 @@ async def start(message: types.Message):
|
||||||
|
|
||||||
|
|
||||||
@dp.message_handler(commands="help")
|
@dp.message_handler(commands="help")
|
||||||
async def send_welcome(message: types.Message):
|
async def help_cmd(message: types.Message):
|
||||||
await message.chat.do(types.ChatActions.TYPING)
|
await message.chat.do(types.ChatActions.TYPING)
|
||||||
logger.info(f"{message.from_user.username} do help command: {message.text}")
|
logger.info(f"{message.from_user.username} do help command: {message.text}")
|
||||||
with dbL:
|
with dbL:
|
||||||
|
@ -133,13 +133,13 @@ async def edt_cmd(message: types.Message):
|
||||||
|
|
||||||
|
|
||||||
@dp.message_handler(commands="kfet")
|
@dp.message_handler(commands="kfet")
|
||||||
async def edt_cmd(message: types.Message):
|
async def kfet(message: types.Message):
|
||||||
user_id = str(message.from_user.id)
|
user_id = str(message.from_user.id)
|
||||||
await message.chat.do(types.ChatActions.TYPING)
|
await message.chat.do(types.ChatActions.TYPING)
|
||||||
logger.info(f"{message.from_user.username} do kfet command: {message.text}")
|
logger.info(f"{message.from_user.username} do kfet command: {message.text}")
|
||||||
with dbL:
|
with dbL:
|
||||||
with shelve.open("edt", writeback=True) as db:
|
with shelve.open("edt", writeback=True) as db:
|
||||||
if not 9 < get_now().hour < 14 or not get_now().isoweekday() < 5:
|
if not 9 < get_now().hour < 14 or not get_now().isoweekday() < 6:
|
||||||
msg = lang(db[user_id], "kfet_close")
|
msg = lang(db[user_id], "kfet_close")
|
||||||
else:
|
else:
|
||||||
msg = lang(db[user_id], "kfet_list")
|
msg = lang(db[user_id], "kfet_list")
|
||||||
|
@ -150,7 +150,7 @@ async def edt_cmd(message: types.Message):
|
||||||
|
|
||||||
|
|
||||||
@dp.message_handler(commands="setkfet")
|
@dp.message_handler(commands="setkfet")
|
||||||
async def edt_cmd(message: types.Message):
|
async def kfet_set(message: types.Message):
|
||||||
user_id = str(message.from_user.id)
|
user_id = str(message.from_user.id)
|
||||||
await message.chat.do(types.ChatActions.TYPING)
|
await message.chat.do(types.ChatActions.TYPING)
|
||||||
logger.info(f"{message.from_user.username} do setkfet command: {message.text}")
|
logger.info(f"{message.from_user.username} do setkfet command: {message.text}")
|
||||||
|
|
Reference in a new issue