Giter VIP home page Giter VIP logo

suppgram's Introduction

Suppgram — Telegram-based support system

What problem does it solve?

Small and medium-sized b2c businesses often face the necessity to hire multiple support agents to handle the flow of incoming requests from customers. But enterprise support systems are very expensive and quite complex.

Suppgram provides a simple Telegram-based interface for your support agents, and a multitude of ways for your customers to reach them.

How does it work?

1. Customers contact your support service via a multitude of different mediums (Telegram bot, e-mail, etc.).

2. New customer requests are shown to your support agents, with possibility to assign a conversation to an agent or mark it with tags.

3. Support agents are assigned to conversations and are able to chat with the customers via a unified interface, eventually marking chats as resolved.

How to use it?

See Quickstart!

How to contribute?

See Contribution guide!

suppgram's People

Contributors

saluev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

alkalit sdzerg

suppgram's Issues

Quickstart, While trying to "Assign to me" a conversation, i get exception

While trying to "Assign to me" a conversation, i get exception:
ERROR:telegram.ext.Application:No error handlers are registered, logging exception.
Traceback (most recent call last):
File "/home/alex/Suppgram/venv/lib/python3.10/site-packages/telegram/ext/_application.py", line 1264, in process_update
await coroutine
File "/home/alex/Suppgram/venv/lib/python3.10/site-packages/telegram/ext/_handlers/basehandler.py", line 157, in handle_update
return await self.callback(update, context)
File "/home/alex/Suppgram/venv/lib/python3.10/site-packages/suppgram/frontends/telegram/manager_frontend.py", line 394, in _handle_callback_query
await self._backend.assign_agent(agent, agent, conversation_id)
File "/home/alex/Suppgram/venv/lib/python3.10/site-packages/suppgram/backends/local.py", line 176, in assign_agent
workplace = await self._choose_workplace(assignee)
File "/home/alex/Suppgram/venv/lib/python3.10/site-packages/suppgram/backends/local.py", line 269, in _choose_workplace
return available_workplaces[0] # TODO handle index out of range
IndexError: list index out of range

Builder creation failed with Python 3.12: "Builder finalization failed" error

I am encountering an issue when trying to use the suppgram library in my Python project with Python 3.12. The builder creation process fails with the error "Builder finalization failed." Here are the details

Steps to Reproduce:

  1. Install suppgram via pip in a virtual environment using Python 3.12.
  2. Use the following code to configure and build the suppgram builder:

import asyncio
import logging

from suppgram.builder import Builder

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(name)

async def main():
try:
logger.debug("Starting to build the suppgram builder.")
builder = Builder()

    logger.debug("Configuring SQLAlchemy storage.")
    builder = builder.with_sqlalchemy_storage("sqlite+aiosqlite:///test.db")
    if builder is None:
        raise ValueError("SQLAlchemy storage configuration failed")
    logger.debug(f"SQLAlchemy storage configured: {builder}")

    logger.debug("Configuring Telegram manager frontend.")
    builder = builder.with_telegram_manager_frontend("*******", *******)
    if builder is None:
        raise ValueError("Telegram manager frontend configuration failed")
    logger.debug(f"Telegram manager frontend configured: {builder}")

    logger.debug("Configuring Telegram customer frontend.")
    builder = builder.with_telegram_customer_frontend("**********")
    if builder is None:
        raise ValueError("Telegram customer frontend configuration failed")
    logger.debug(f"Telegram customer frontend configured: {builder}")

    logger.debug("Configuring Telegram agent frontend.")
    builder = builder.with_telegram_agent_frontend(["************"])
    if builder is None:
        raise ValueError("Telegram agent frontend configuration failed")
    logger.debug(f"Telegram agent frontend configured: {builder}")

    logger.debug("Finalizing the builder.")
    builder = builder.build()
    if builder is None:
        raise ValueError("Builder finalization failed")
    logger.debug(f"Builder finalized: {builder}")

    if builder is not None:
        logger.debug("Builder created successfully")
        await builder.start()
        await asyncio.Event().wait()  # This will keep the script running
    else:
        logger.error("Builder creation failed")
except Exception as e:
    logger.exception("An error occurred during builder creation or execution")
    print(f"An error occurred: {e}")

if name == "main":
asyncio.run(main())

Observed Behavior:
The process fails with the following error message:
ValueError: Builder finalization failed

Logs:
DEBUG:main:Starting to build the suppgram builder.
DEBUG:main:Configuring SQLAlchemy storage.
DEBUG:main:Configuring Telegram manager frontend.
DEBUG:main:Configuring Telegram customer frontend.
DEBUG:main:Configuring Telegram agent frontend.
DEBUG:main:Finalizing the builder.
INFO:suppgram.builder:Initializing Telegram customer frontend
DEBUG:main:Builder finalized: None
ERROR:main:Builder creation failed

Environment:

OS: Windows 10
Python Version: 3.12
Suppgram Version: [Specify the version you are using]
Other relevant packages: httpx

Additional Information:
I've checked the tokens and IDs multiple times, and they seem to be correct. I also tried running individual components separately, and they work fine. The issue seems to occur during the build() method.

Any guidance or suggestions to resolve this issue would be greatly appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.