Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/szsascha/kafka-telegram-bot-example

Telegram webhook echo bot using Go and Kafka.
https://github.com/szsascha/kafka-telegram-bot-example

cicd deployment devops docker docker-compose github-actions golang kafka telegram-bot

Last synced: about 2 months ago
JSON representation

Telegram webhook echo bot using Go and Kafka.

Awesome Lists containing this project

README

        

# Telegram echo bot using Kafka

With this repository I created a simple Telegram echo bot in order to learn more about Go and Kafka.

The echo bot consists of 3 services:
- telegram-callback: Endpoint for Telegram webhook. Writes content to incoming_messages Kafka topic.
- telegram-message-processor: Reads incoming_messages topic, processes the message and sent the client a message via outgoing_messages topic
- telegram-sender: Receives the outgoing_messages topic and creates the Telegram message

## Futher notes
- The production environment uses a proxy like https://github.com/szsascha/caddy-proxy (HTTPS handling is done in the proxy)
- Run a service directly via `go run telegram-callback/telgram-callback.go`
- Set Telegram webhook via POST https://api.telegram.org/bot{{token}}/setWebhook?url=https://{{serveraddress}}/{{token}}
- The current setup is created for use in github actions only
- Kafka port docker internally: 29092
- Kafka port from outsite docker: 9092
- Keep your token safe!