Handler EMail#

Handler EMail: Add / Del / Edit / Verify#

Module for handler operations of EMail-DB.

class handler_email.HandlerEM(bot, admin_id)[source]#

Class for manage EMail (add / delete / edit).

Parameters:
  • bot (Bot) –

  • admin_id (int) –

async __add_new_email_to_db(message, state, email_edit_mode='OFF', new_email_from_edit_set='None')#

Add a new EMail. | Step 2. | Adding a new EMail to DB.

Parameters:
  • message (aiogram.types.message.Message | aiogram.types.callback_query.CallbackQuery) – EMail.

  • state (FSMContext) – FSM.

  • email_edit_mode – Edit-Mode (OFF/ON).

  • new_email_from_edit_set – None, if the mode is OFF.

Returns:

None.

Return type:

None

async __add_new_email_to_db_enter_the_code(message, state)#

Add a new EMail. | Step 3. | Adding a new EMail to DB.

Parameters:
  • message (Message) – Code from user (from EMail for check / valid).

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async __confirmation_to_edit_email_from_email_settings(call, state)#

Edit EMail-data from DB / File (for admin) bot.json. | Confirmation-Step.

Parameters:
  • call (CallbackQuery) – Callback Query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async __edit_email_from_settings_menu(call)#

Edit EMail-data from DB / File (for admin) bot.json.

Parameters:

call (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async __editing_email_process_step_after_confirmation(message, state)#

Get new EMail from the user / admin.

Parameters:
  • message (Message) – Message - New EMail.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async __generate_code()#

Func for generate temp code for verification email (user / admin).

Return type:

str

async __get_data_email(id_user)#

Get EMail.

Parameters:

id_user – User ID.

Returns:

None.

Return type:

str

async __show_email_from_settings_menu(call)#

Show EMail-data from DB / File (for admin) bot.json.

Parameters:

call (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async add_new_email(call, state)[source]#

Add a new EMail. | Step 1. | Enter a new EMail.

Parameters:
  • call (CallbackQuery) – Callback Query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async show_email_settings_menu(call)[source]#

Show EMail settings menu.

Parameters:

call (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async static valid_email(email)[source]#

Valid EMail.

Parameters:

email (str) – EMail for valid.

Returns:

Result.

Return type:

bool