Skip to main content

Set a gateway for telegram

Project description

Beta License: AGPL-3 OCA/social Translate me on Weblate Try me on Runboat

This module allows to respond telegram chats as a telegram bot.

This way, a group of users can respond customers or any other set of partners in an integrated way.

It is not intended to be integrated on default chatter as users don’t need to review again when one has responded.

Table of contents

Configuration

Create the bot

  1. Create a Bot on telegram https://core.telegram.org/bots

  2. Create a broker following the examples on https://github.com/tegin/telegram-broker with the TOKEN provided

Configure Odoo

  1. Access on debug mode

  2. Access Settings > Technical Settings > Email > Mail Gateway.

  3. Access Telegram and start a converstation with BotFather.

  4. Create a bot using the command /newbot. The system will ask for a bot name. Remember that it needs to end with the word bot.

  5. Copy the token to access the HTTP API to the token field.

  6. Define Webhook key an webhook secret of your choice in its corresponding field, in order to secure the connection.

  7. Press save button and the integrate webhook smart button will appear.

  8. Press the Integrate webhook button.

  9. If you want to add an extra layer of security, you can check Has New Channel Security and define a Telegram security key. New chats will be created only with the command /start SECURITY_KEY.

Limitations

The Webhook functionality can only be used if your system is accessible from website. On local installations it might be problematic as Telegram will not be able to contact your system. In that case, you might need to create a telegram bot that will send data to you on an external process with the following code.

from telegram.ext import Filters, MessageHandler, Updater
import requests
dp = Updater(YOUR_TOKEN)

def message_callback(update, _context):
    requests.post(YOUR_CONTROLLER, json=update.to_dict())


dp.dispatcher.add_handler(MessageHandler(Filters.all, message_callback))
dp.start_polling()
dp.idle()

Usage

  1. Access Gateway

  2. Wait until someone starts a conversation with your bot.

  3. Now you will be able to respond and receive messages to this person.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Creu Blanca

  • Dixmit

Contributors

Other credits

This work has been funded by AEOdoo (Asociación Española de Odoo - https://www.aeodoo.org)

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

This module is part of the OCA/social project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

File details

Details for the file odoo_addon_mail_gateway_telegram-16.0.1.0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_addon_mail_gateway_telegram-16.0.1.0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d766fa280160e0a8da7d9509c15f3120f943ec5872a71dea03e198bb5fcffd2c
MD5 e75a6a002991244ff0a8aa9247b90d18
BLAKE2b-256 281794bc76482ecd112a4e500a7230fb2ba28d09ea7b63625d9c4bee77361fdb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page