async def categories(message: types.Message): user_id = message.chat.id keyboard = keyboard_main.force_reply() await bot.send_message(user_id, texts["number_qiwi"], reply_markup=keyboard) pass # перезапуск qiwi-модуля
async def new_item_name(message: types.Message): table = db_main.Table(tables.names_dict["items"]) table.insert("name", message.text) table.close() await bot.send_message(message.chat.id, texts["new_item_description"], reply_markup=keyboard_main.force_reply())
async def new_item_price(message: types.Message): table = db_main.Table(tables.names_dict["items"]) data = table.select_by_max("id", "id") id = data[0][0] table.update("id", id, "price", message.text) table.close() await bot.send_message(message.chat.id, texts["new_item_photo"], reply_markup=keyboard_main.force_reply())
async def number_qiwi(message: types.Message): table = db_main.Table(tables.names_dict["texts"]) table.update("title", "number", "text", message.text) table.close() update_constants() user_id = message.chat.id keyboard = keyboard_main.force_reply() await bot.send_message(user_id, texts["token_qiwi"], reply_markup=keyboard)
async def new_item_category(message: types.Message): table = db_main.Table(tables.names_dict["items"]) data = table.select_by_max("id", "id") id = data[0][0] table.update("id", id, "photo_id", message.photo[0].file_id) table.close() # print (message.photo[0].file_id) # print (message.reply_to_message) # print ("---\nphoooto\n---") # # media = types.MediaGroup() # for photo in message.photo: # media.attach_photo(photo.file_id) # await bot.send_media_group(message.chat.id, media=media) text_categories = "" for i, category in enumerate(categories): text_categories += "\n{i}. {category}".format(i=i + 1, category=category) await bot.send_message(message.chat.id, texts["new_item_category"] + text_categories, reply_markup=keyboard_main.force_reply())
async def manager_question(message: types.Message): await bot.send_message(message.chat.id, texts["manager_question"], reply_markup=keyboard_main.force_reply())
async def categories(message: types.Message): user_id = message.chat.id keyboard = keyboard_main.force_reply() await bot.send_message(user_id, texts["new_adress"], reply_markup=keyboard)