Before getting started, ensure you have the following installed:
-
Run Your Local Bot API Server
- Follow the instructions to set up your local server from the official documentation. If you don't want to build it yourself, you can check tdlib.native.
-
Obtain API Credentials
- Get your
api-id
andapi-hash
from the Telegram API.
- Get your
-
Start the Server
- Run the bot API server using the following command:
telegram-bot-api --api-id YOUR_API_ID --api-hash YOUR_API_HASH --http-port 7575 --local
- Run the bot API server using the following command:
-
Log Out the Bot from the Official API
-
Open this link in your browser:
https://api.telegram.org/bot<YOUR_TOKEN>/logOut
-
Make sure to replace
<YOUR_TOKEN>
with your actual bot token. You should see a JSON response that looks like this:{"ok":true,"result":true}
-
-
Interact with the Bot
-
Rename
.env-example
to.env
and add your bot token there (or pass it to the script with-t <TOKEN>
). Then run the bot:uv run bot.py
-
We welcome contributions from the community! Feel free to submit issues, fork the project, and create pull requests.