Customer frontends

suppgram.frontend.CustomerFrontend

This component is responsible for interacting with the customers within some external system (e.g. Telegram).

initialize() async

Performs asynchronous initialization if needed.

start() abstractmethod async

Starts serving the frontend, be it long polling loop or an HTTP server.


suppgram.frontends.telegram.TelegramCustomerFrontend

Bases: CustomerFrontend

Allows customers to access the support system via Telegram bot.

All messages from all users to a specific Telegram bot will be considered messages to the support. When agent responds, the bot will copy agent's message content and send it to the customer. Important: the message will be copied, not forwarded; thus the agent's identity will remain hidden.

__init__(token, app_manager, backend, storage, texts)

This constructor should not be used directly; use Builder instead.

Parameters:
  • token (str) –

    Telegram bot token.

  • app_manager (TelegramAppManager) –

    helper object storing built telegram.ext.Application instances.

  • backend (Backend) –

    used backend instance.

  • storage (TelegramStorage) –

    helper object encapsulating persistent storage of Telegram-specific data.

  • texts (TextProvider) –

    texts provider.


suppgram.frontends.pubnub.PubNubCustomerFrontend

Bases: CustomerFrontend

Allows customers to access the support system via PubNub channels.

All channels from a specific PubNub channel group will be considered individual chats with support. When agent responds, agent's message content will be copied and sent to the customer on behalf of a particular PubNub user (e.g. with user ID "support").

__init__(backend, message_converter, pubnub_channel_group, pubnub_configuration)

This constructor should not be used directly; use Builder instead.

Parameters:
  • backend (Backend) –

    used backend instance.

  • message_converter (MessageConverter) –

    helper object responsible for converting messages between Suppgram dataclasses and project-specific PubNub JSONs.

  • pubnub_channel_group (str) –

    name of PubNub channel group which includes all individual chats with support. Will be used to subscribe for updates from all those chats at once.

  • pubnub_configuration (Configuration) –

    PubNub client configuration.


suppgram.frontends.shell.ShellCustomerFrontend

Bases: CustomerFrontend

Allows customers to access the support system via terminal.

Useful for debug purposes.

__init__(backend, texts)

Parameters:
  • backend (Backend) –

    used backend instance.

  • texts (TextProvider) –

    texts provider.