Beispiel #1
0
 async def display_addresses(self, message: Message, edit=False):
     addresses = self.my_addresses
     if not addresses:
         await message.answer(self.loc.TEXT_NO_ADDRESSES,
                              reply_markup=kbd([self.loc.BUTTON_BACK]),
                              disable_notification=True)
     else:
         if edit:
             await message.edit_text(self.loc.TEXT_YOUR_ADDRESSES, reply_markup=self.kbd_for_addresses())
         else:
             await message.answer(self.loc.TEXT_YOUR_ADDRESSES, reply_markup=self.kbd_for_addresses())
 async def on_enter(self, message: Message):
     if message.text == self.loc.BUTTON_SM_BACK_MM:
         await self.go_back(message)
     elif message.text == self.loc.BUTTON_SET_LANGUAGE:
         await self.ask_language(message)
     else:
         await SettingsStates.MAIN_SETTINGS_MENU.set()
         await message.reply(
             self.loc.TEXT_SETTING_INTRO,
             reply_markup=kbd(
                 [self.loc.BUTTON_SET_LANGUAGE, self.loc.BUTTON_SM_BACK_MM],
                 vert=True))
Beispiel #3
0
    async def on_enter(self, message: Message):
        if message.text == self.loc.BUTTON_SM_BACK_MM:
            await self.go_back(message)
        else:
            await StakeStates.MAIN_MENU.set()
            address = message.text.strip()
            if address:
                if MyStakeAddress.is_good_address(address):
                    self.add_address(address, BNB_CHAIN)
                else:
                    await message.answer(code(self.loc.TEXT_INVALID_ADDRESS),
                                         disable_notification=True)

            await self.display_addresses(message)
            msg = self.loc.TEXT_SELECT_ADDRESS_ABOVE if self.my_addresses else ''
            msg += self.loc.TEXT_SELECT_ADDRESS_SEND_ME
            await message.answer(msg, reply_markup=kbd([self.loc.BUTTON_SM_BACK_MM]),
                                 disable_notification=True)
 def menu_kbd(self):
     return kbd([
         self.loc.BUTTON_AVA_FROM_MY_USERPIC,
         self.loc.BUTTON_SM_BACK_MM,
     ],
                vert=True)
Beispiel #5
0
 def kbd_main_menu(self):
     return kbd([[self.BUTTON_MM_MY_ADDRESS, self.BUTTON_MM_METRICS],
                 [self.BUTTON_MM_MAKE_AVATAR, self.BUTTON_MM_SETTINGS]])
Beispiel #6
0
 def lang_help(self):
     return (f'Пожалуйста, выберите язык / Please select a language',
             kbd([self.BUTTON_RUS, self.BUTTON_ENG], one_time=True))