TelegramAutomation
Use Python to control the Telegram client
Install / Use
/learn @automation9417/TelegramAutomationREADME
Telegram Automation
Overview
It is a sample of using Python code to control the Telegram client and send messages to contacts and the Telegram channel.
Step by Step
-
Log in to your Telegram client.
-
Capture the search bar
- Click
Capturebutton
<!-- #(https://s1.328888.xyz/2022/10/08/fW1Rm.png) --> - Use
Ctrl + Clickto capture search bar

- Get the search bar locator

- Validate the locator

The validation would be failed. The most simple way to debug this issue, we can use a new feature provided by Clicknium:
<!-- https://s1.328888.xyz/2022/10/08/fWJpo.png -->Recapture & Compare
After recapturing the search bar, we can get the compared model to check the difference between the old and new.
<!-- https://s1.328888.xyz/2022/10/08/fWyOF.png -->
It's easy to get the difference between the old and new is the
nameattribute. There is a number that follows the word "Telegram." We can use the wildcard to fix it by changing the number383784to*and saving the locator. Validate again, and it will succeed. - Click
-
Set text into the search bar
- Include the Clicknium package into your Python code and set the contacts name into the search bar using Clicknium API.
from clicknium import clicknium as cc, locator
cc.find_element(locator.telegram.contact_search).set_text("DK H")
- Select the contacts by pressing the
Enterkey. More codes of the key can be found at the page
cc.send_hotkey("{ENTER}")
- Capture the message text input and send messages button using the same way as step 3.
- Code the workflow into Python. You can check the sample in the sample.py file.
Related Skills
imsg
339.5kiMessage/SMS CLI for listing chats, history, and sending messages via Messages.app.
node-connect
339.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
oracle
339.5kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
lobster
339.5kLobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (s
