Business#

Business module. Manage main functions#

Module of the Manager-Business-Helper Bot.

class business.AISector[source]#

AI Sector-class.

async static ai_assistance(bot, call_query)[source]#

Handler (callback-handler) for go to the AI-Menu.

Parameters:
  • bot (Bot) – The Bot-object.

  • call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async static ai_two_in_one_main_menu(bot, call_query, admin_id)[source]#

Handler (callback-handler) for explore to AI-menu.

Parameters:
  • bot (Bot) – The Bot-object.

  • call_query (CallbackQuery) – Callback Query.

  • admin_id (int) – Admin ID (telegram ID).

Returns:

None.

Return type:

None

async static generate_image_for_premium_user(bot, call, state)[source]#

Generate image for premium-user.

Parameters:
  • bot (Bot) – The Bot-object.

  • call (CallbackQuery) – Callback Query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

class business.EmailSector[source]#

Email sector-class.

async static add_new_email(bot, call_query, state, admin_id)[source]#

Handler (callback-handler) for add a new EMail.

Parameters:
  • bot – The Bot-object.

  • call_query (CallbackQuery) – Callback Query.

  • state (FSMContext) – FSM.

  • admin_id (int) – Admin ID (telegram ID).

Returns:

None.

Return type:

None

async static email_settings_menu(bot, call_query, admin_id)[source]#

Menu of EMail Settings for any users and admin.

Parameters:
  • bot – The Bot-object.

  • call_query (CallbackQuery) – Callback Query.

  • admin_id (int) – Admin ID (telegram ID).

Returns:

None.

Return type:

None

class business.FinanceSector[source]#

Finance sector-class.

async static pre_checkout_query(bot, pre_checkout_query)[source]#

Pre-Checkout TelegramPay Function.

Parameters:
  • bot (Bot) – The Bot-object.

  • pre_checkout_query (PreCheckoutQuery) – Pre-Checkout-query.

Returns:

None.

Return type:

None

async static refund(bot, call)[source]#

Refund-menu for admin use / control.

Parameters:
  • bot (Bot) – The Bot-object.

  • call (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async static refunding_step1(bot, call, state)[source]#

Call-Handler for refund stars | Step 1.

Parameters:
  • bot (Bot) – The Bot-object.

  • call (CallbackQuery) – Callback Query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async static successful_payment(bot, message, admin_id)[source]#

Handler for successful payment.

Parameters:
  • bot (Bot) – The Bot-object.

  • message (Message) – Message from user.

  • admin_id (int) – Admin ID (telegram ID).

Returns:

None.

Return type:

None

class business.Manager(bot_token, business_conn_id, admin_id, mysql_data, gigachat_data, admin_username)[source]#

Manager of the Admin Account and helper ‘AI’.

Parameters:
  • bot_token (str) –

  • business_conn_id (str) –

  • admin_id (int) –

  • mysql_data (dict) –

  • gigachat_data (dict) –

  • admin_username (str) –

async __add_new_email(call_query, state)#

Handler (callback-handler) for add a new EMail.

Parameters:
  • call_query (CallbackQuery) – Callback Query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async __admin_menu_tickets(call_query)#

Handler (callback-handler) for show tickets to admin.

Parameters:

call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async __ai_assistance(call_query)#

Handler (callback-handler) for go to the AI-Menu.

Parameters:

call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async __ai_two_in_one_main_menu(call_query)#

Handler (callback-handler) for explore to AI-menu.

Parameters:

call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async __analytic_data(call_query)#

Handler of the analytic-menu (UI) for admin.

Parameters:

call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async __answer_to_user(message)#

Answer to a user from admin-account (as admin).

Parameters:

message (Message) – Message of a user.

Returns:

None.

Return type:

None

async __back_on_main(call)#

Handler for return to main-menu.

Parameters:

call (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async __business_and_money(call_query)#

Handler (callback-handler) for explore to BusinessAndMoney-menu.

Parameters:

call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async __business_handler(call_query)#

Handler (call-query) for admin (with business) - start main handler.

Parameters:

call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async __continue_subscribe_premium(call_query)#

Continue to subscribe CW PREMIUM. Choose method of payment.

Parameters:

call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async __email_settings_menu(call_query)#

Menu of EMail Settings for any users and admin.

Parameters:

call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async __eng_privacy(call_query)#

Explore to show ENG Privacy.

Parameters:

call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async __enter_promo_code(call, state)#

Func ‘ENTER’ a promo code from user. | Step 1.

Parameters:
  • call (CallbackQuery) – CallbackQuery.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async __explore_answer_admin_by_ticket(call_query, state)#

Handler (call-handler) for get id ticket for answer to admin.

Parameters:
  • call_query (CallbackQuery) – Callback Query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async __explore_answer_users_ticket(call_query, state)#

Handler (call-handler) for get id ticket for answer to user.

Parameters:
  • call_query (CallbackQuery) – Callback Query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async __explore_show_users_ticket(call_query, state)#

Explore to show user’s ticket by id.

Parameters:
  • call_query (CallbackQuery) – Callback Query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async __generate_image_for_premium_user(call, state)#

Generate image for premium-user.

Parameters:
  • call (CallbackQuery) – Callback Query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async __get_id_ticket_for_show(message, state)#

Get id ticket for admin answer/view or user view.

Parameters:
  • message (Message) – Message (ID ticket) from admin/the user.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async __get_main_menu(message)#

Handler for go to main-menu.

Parameters:

message (Message) – Message.

Returns:

None.

Return type:

None

async __get_or_lk_premium(call_query)#

Get CW PREMIUM or view (look at) “MY PREMIUM”.

Parameters:

call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async __pre_checkout_query(pre_checkout_query)#

Pre-Checkout TelegramPay Function.

Parameters:

pre_checkout_query (PreCheckoutQuery) – Pre-Checkout-query.

Returns:

None.

Return type:

None

async __privacy(message)#

Privacy for the users.

Parameters:

message (Message) – Message / Command Privacy.

Returns:

None.

Return type:

None

async __refund(call)#

Refund-menu for admin use / control.

Parameters:

call (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async __refunding_step1(call, state)#

Call-Handler for refund stars | Step 1.

Parameters:
  • call (CallbackQuery) – Callback Query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async __rus_privacy(call_query)#

Explore to show RUS Privacy.

Parameters:

call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async __show_promo_menu_admin(call_query)#

Show PROMO Menu. | Control ADMIN.

Parameters:

call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async __standard_message(message)#

Answer to the users and admin.

Parameters:

message (Message) – Message.

Returns:

None.

Return type:

None

async __successful_payment(message)#

Handler for successful payment.

Parameters:

message (Message) – Message from user.

Returns:

None.

Return type:

None

async __user_menu_tickets(call_query)#

Handler (callback-handler) for go to the Tickets-Menu.

Parameters:

call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async run()[source]#

Run-function Bot.

Return type:

None

class business.MenuSector[source]#

The class-sector of manage MENU-functions.

async static back_on_main(bot, call, admin_id)[source]#

Handler for return to main-menu.

Parameters:
  • bot (Bot) – The Bot-object.

  • call (CallbackQuery) – Callback Query.

  • admin_id (int) – Admin ID (telegram ID).

Returns:

None.

Return type:

None

async static get_main_menu(bot, message, admin_id)[source]#

Handler for go to main-menu.

Parameters:
  • bot (Bot) – The Bot-object.

  • message (Message) – Message.

  • admin_id (int) – Admin ID (telegram ID).

Returns:

None.

Return type:

None

class business.PremiumFunctionsSector[source]#

Class for manage Premium functions

async static business_and_money(bot, call_query)[source]#

Handler (callback-handler) for explore to BusinessAndMoney-menu.

Parameters:
  • bot (Bot) – The Bot-object.

  • call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async static business_handler(bot, call_query)[source]#

Handler (call-query) for admin (with business) - start main handler.

Parameters:
  • bot (Bot) – The Bot-object.

  • call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async static continue_subscribe_premium(bot, call_query, admin_id)[source]#

Continue to subscribe CW PREMIUM. Choose method of payment.

Parameters:
  • bot (Bot) – The Bot-object.

  • call_query (CallbackQuery) – Callback Query.

  • admin_id (int) – Admin ID (telegram ID).

Returns:

None.

Return type:

None

async static get_or_lk_premium(bot, call_query, admin_id, admin_username)[source]#

Get CW PREMIUM or view (look at) “MY PREMIUM”.

Parameters:
  • bot (Bot) – The Bot-object.

  • call_query (CallbackQuery) – Callback Query.

  • admin_id (int) – Admin ID (telegram ID).

  • admin_username (str) – Admin USERNAME (telegram USERNAME).

Returns:

None.

Return type:

None

async static show_promo_menu_admin(bot, call_query, admin_id)[source]#

Show PROMO Menu. | Control ADMIN.

Parameters:
  • bot (Bot) – The Bot-object.

  • call_query (CallbackQuery) – Callback Query.

  • admin_id (int) – Admin ID (telegram ID).

Returns:

None.

Return type:

None

class business.PrivacyMessagesSector[source]#

Sender-class of privacy messages.

async static eng_privacy(bot, call_query)[source]#

Explore to show ENG Privacy.

Parameters:
  • bot (Bot) – The bot object

  • call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async static privacy(bot, message)[source]#

Privacy for the users.

Parameters:
  • bot (Bot) – The bot object

  • message (Message) – Message / Command Privacy.

Returns:

None.

Return type:

None

async static rus_privacy(bot, call_query)[source]#

Explore to show RUS Privacy.

Parameters:
  • bot (Bot) – The bot object

  • call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

class business.PromoFunctionsSector[source]#

The class of Promo functions.

async static enter_promo_code(bot, call, state, admin_id)[source]#

Func ‘ENTER’ a promo code from user. | Step 1.

Parameters:
  • bot (Bot) – The Bot-object.

  • call (CallbackQuery) – CallbackQuery.

  • state (FSMContext) – FSM.

  • admin_id (int) – Admin ID (telegram ID).

Returns:

None.

Return type:

None

async static show_promo_menu_admin(bot, call_query, admin_id)[source]#

Show PROMO Menu. | Control ADMIN.

Parameters:
  • bot (Bot) – The Bot-object.

  • call_query (CallbackQuery) – Callback Query.

  • admin_id (int) – Admin ID (telegram ID).

Returns:

None.

Return type:

None

class business.TicketsSector[source]#

Ticket-Manage Class.

async static admin_menu_tickets(bot, call_query, mysql_data)[source]#

Handler (callback-handler) for show tickets to admin.

Parameters:
  • bot (Bot) – The Bot-object.

  • call_query (CallbackQuery) – Callback Query.

  • mysql_data (dict) – MySQL (Database) data.

Returns:

None.

Return type:

None

async static explore_answer_admin_by_ticket(bot, call_query, state, admin_id, mysql_data)[source]#

Handler (call-handler) for get id ticket for answer to admin.

Parameters:
  • bot (Bot) – The Bot-object.

  • call_query (CallbackQuery) – Callback Query.

  • state (FSMContext) – FSM.

  • admin_id (int) – Admin ID (telegram ID).

  • mysql_data (dict) – MySQL (Database) data.

Returns:

None.

Return type:

None

async static explore_answer_users_ticket(bot, call_query, state, admin_id, mysql_data)[source]#

Handler (call-handler) for get id ticket for answer to user.

Parameters:
  • bot (Bot) – The Bot-object.

  • call_query (CallbackQuery) – Callback Query.

  • state (FSMContext) – FSM.

  • admin_id (int) – Admin ID (telegram ID).

  • mysql_data (dict) – MySQL (Database) data.

Returns:

None.

Return type:

None

async static explore_show_users_ticket(bot, call_query, state)[source]#

Explore to show user’s ticket by id.

Parameters:
  • bot (Bot) – The Bot-object.

  • call_query (CallbackQuery) – Callback Query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async static get_id_ticket_for_show(bot, message, state, mysql_data)[source]#

Get id ticket for admin answer/view or user view.

Parameters:
  • bot (Bot) – The Bot-object.

  • message (Message) – Message (ID ticket) from admin/the user.

  • state (FSMContext) – FSM.

  • mysql_data (dict) – MySQL (Database) data.

Returns:

None.

Return type:

None

async static user_menu_tickets(bot, call_query, mysql_data)[source]#

Handler (callback-handler) for go to the Tickets-Menu.

Parameters:
  • bot (Bot) – The Bot-object.

  • call_query (CallbackQuery) – Callback Query.

  • mysql_data (dict) – MySQL (Database) data.

Returns:

None.

Return type:

None

business.get_data(file_path='bot.json')[source]#

Get data of the Alex’s Manager Bot.

Parameters:

file_path – File Path of JSON-API-keys for Bot.

Returns:

Dict with data.

Return type:

dict

async business.run()[source]#

Run Function of the main-file.

Returns:

None.

Return type:

None