TDLib Server
TDLib Server is a high-performance Go server built to scale Telegram bots using TDLib and RabbitMQ.
Table of Contents
Features
- Easy to Use: Simple setup and configuration for quick integration.
- High Performance: Optimized for scaling high-loaded Telegram bots.
- Go-Powered: Built with Go for concurrency and speed.
- RabbitMQ Integration: Seamless integration with RabbitMQ for efficient asynchronous message handling.
Usage
Here’s an example of how you can use Pytdbot to interact with TDLib Server:
import asyncio
import logging
from pytdbot import Client
from pytdbot.types import Message
logging.basicConfig(
level=logging.INFO,
format="[%(levelname)s][%(filename)s:%(lineno)d][%(funcName)s] %(message)s",
)
client = Client(
token="508903:AAGyYP5y63ihh_7KFX9aNiaHfajAmcAA",
rabbitmq_url="amqp://username:password@0.0.0.0:5672/", # RabbitMQ URL
)
@client.on_message()
async def say_hello(c: Client, message: Message):
msg = await message.reply_text("Hey there! I'm cooking up a surprise... 🍳👨🍳")
async with message.action("choose_sticker"):
await asyncio.sleep(5)
await msg.edit_text("Boo! 👻 Just kidding.")
client.run()
Installation
Follow these steps to set up and build TDLib Server on your system.
Requirements
Once TDLib and RabbitMQ are installed, you're ready to build TDLib Server:
Configuration
All configuration options can be found in config.ini.
You can also view the available cli options by running:
tdlib-server --help
Acknowledgments
License
This project is licensed under the MIT License.