async def process_callback_button1(callback_query: types.CallbackQuery): if Services.GetUserPersonage(callback_query.from_user.id) == "NotRegistered": await NotRegistered(callback_query.from_user.id) return 0 await callback_query.message.edit_text(Services.FormatUserToBeautifullMsg(Services.GetUserPersonage(callback_query.from_user.id)), reply_markup=menuKb)
async def process_callback_button1(callback_query: types.CallbackQuery): if Services.GetUserPersonage(callback_query.from_user.id) == "NotRegistered": await NotRegistered(callback_query.from_user.id) return 0 executeResult = await Services.ExecuteEatActivity(eatId=callback_query.data.replace('eat_',''), userId=callback_query.from_user.id) if executeResult == 'NotHaveMoney': await bot.answer_callback_query(callback_query.id, text="Тебе не хватает денег на это))", show_alert=True) elif executeResult == 'Eat_die': await bot.answer_callback_query(callback_query.id, text="Ты помер с голоду)))", show_alert=True) await Вeath(callback_query.from_user.id) elif executeResult == 'Health_die': await bot.answer_callback_query(callback_query.id, text="Ты помер)))", show_alert=True) await Вeath(callback_query.from_user.id) elif executeResult == 'Happy_die': await bot.answer_callback_query(callback_query.id, text="Ты повесился))))", show_alert=True) await Вeath(callback_query.from_user.id) else: await callback_query.message.edit_text(Services.FormatUserToBeautifullMsg(Services.GetUserPersonage(callback_query.from_user.id)), reply_markup=CreateEatMurkup())
async def process_start_command(message: types.Message): Msg = await bot.send_message(message.chat.id,"Начинаю регистрацию...") await bot.send_chat_action(message.chat.id, types.ChatActions.TYPING) Services.RegisterNewUser(message.from_user.id, message.from_user.username, message.from_user.first_name, message.from_user.last_name) await Msg.edit_text('Зарегестрирован!') await asyncio.sleep(3) JsonR = Services.GetUserPersonage(message.chat.id) await bot.send_message(message.chat.id, Services.FormatUserToBeautifullMsg(JsonR), reply_markup=menuKb)
async def process_callback_button1(callback_query: types.CallbackQuery): if Services.GetUserPersonage(callback_query.from_user.id) == "NotRegistered": await NotRegistered(callback_query.from_user.id) return 0 if callback_query.data == 'btnM_Profile': await callback_query.message.edit_text( Services.FormatUserProfileToBeautifullMsg(Services.GetUserPersonage(callback_query.from_user.id))) elif callback_query.data == 'btnM_Eat': resultJson = CreateEatMurkup() await callback_query.message.edit_text(Services.FormatUserToBeautifullMsg(Services.GetUserPersonage(callback_query.from_user.id)), reply_markup=resultJson) elif callback_query.data == 'btnM_Happy': await callback_query.message.edit_text(Services.FormatUserToBeautifullMsg(Services.GetUserPersonage(callback_query.from_user.id)), reply_markup=CreateHappyMurkup()) elif callback_query.data == 'btnM_Health': resultJson = CreateHealthMurkup() await callback_query.message.edit_text(Services.FormatUserToBeautifullMsg(Services.GetUserPersonage(callback_query.from_user.id)), reply_markup=resultJson)
async def echo_message(msg: types.Message): if Services.GetUserPersonage(msg.from_user.id) == "NotRegistered": await NotRegistered(msg.from_user.id) return 0 await bot.send_message(msg.chat.id, Services.FormatUserToBeautifullMsg(Services.GetUserPersonage(msg.chat.id)), reply_markup=menuKb)