Tickets#

CW Ticket System for the admin-user / user-admin#

Module of the ticket-system with work in DB MySQL.

class tickets.TicketAdminView(bot, mysql_data)[source]#

Class of the ticket system UI for admin.

Parameters:
  • bot (Bot) –

  • mysql_data (dict) –

async __allow_send_email_ticket_data_admin(call_query)#

Allow to send email for ticket data (big) for admin.

Parameters:

call_query (CallbackQuery) – CallbackQuery.

Returns:

None.

Return type:

None

async __not_allow_send_email_ticket_data_admin(call_query)#

Not allow to send email for ticket data (big) for admin.

Parameters:

call_query (CallbackQuery) – CallbackQuery.

Returns:

None.

Return type:

None

async __show_admin_users_tickets(call_query)#

Function of the show tickets to admin.

Parameters:

call_query (CallbackQuery) – Callback Query by click on the button.

Returns:

None.

Return type:

None

async show_admin_menu(call_query)[source]#

Function of the show menu of admin.

Parameters:

call_query (CallbackQuery) – Callback Query by click on the button.

Returns:

None.

Return type:

None

class tickets.TicketAnswersToAdmin(bot, admin_id, mysql_data)[source]#

Class for manage answers to admin by ticket-system.

Parameters:
  • bot (Bot) –

  • admin_id (int) –

  • mysql_data (dict) –

async __get_ticket_data_for_answer_to_admin(message, state)#

Get ticket-data for answer to user and sending answer to admin.

Parameters:
  • message (Message) – Message of the user.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async explore_answer_admin_by_ticket(call_query, state)[source]#

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

class tickets.TicketAnswersToUsers(bot, admin_id, mysql_data)[source]#

Class for manage answers to users by ticket-system.

Parameters:
  • bot (Bot) –

  • admin_id (int) –

  • mysql_data (dict) –

async __get_ticket_data_for_answer(message, state)#

Get ticket-data for answer to user and sending answer to the user.

Parameters:
  • message (Message) – Message of the user.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async explore_answer_users_ticket(call_query, state)[source]#

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

class tickets.TicketUserView(bot, mysql_data)[source]#

Class of the ticket system UI for users.

Parameters:
  • bot (Bot) –

  • mysql_data (dict) –

async __allow_send_email_ticket_data_user(call_query)#

Allow to send email for ticket data (big) for user.

Parameters:

call_query (CallbackQuery) – CallbackQuery.

Returns:

None.

Return type:

None

async __not_allow_send_email_ticket_data_user(call_query)#

Not allow to send email for ticket data (big) for user.

Parameters:

call_query (CallbackQuery) – CallbackQuery.

Returns:

None.

Return type:

None

async __send_new_ticket(call_query, state)#

Send ticket to admin via Manager Bot in the Menu with mini-UI.

Parameters:
  • call_query (CallbackQuery) – Callback Query.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async __sending_ticket(message, state)#

Sending the ticket from the user to admin and save data of ticket in the DB (MySQL).

Parameters:
  • message (Message) – Message (data ticket) of the user.

  • state (FSMContext) – FSM.

Returns:

None.

Return type:

None

async __show_user_tickets(call_query)#

Show user’s tickets in the Menu with mini-UI.

Parameters:

call_query (CallbackQuery) – Callback Query.

Returns:

None.

Return type:

None

async show_user_menu(call_query)[source]#

Function of the show user’s menu.

Parameters:

call_query (CallbackQuery) – Callback Query by click on the button.

Returns:

None.

Return type:

None