two open-source command-line tools

Find the ID. Search the history. Send, create, clear.

Telegram and Discord bury the IDs everything else needs, and make a few jobs oddly hard — emptying a topic, exporting a thread, editing your bot. Type either tool's name and a menu opens; everything runs on your own machine.

telegram-tools

Your own Telegram account, from the command line.

Telegram hides the numbers everything else needs. This finds them, and does the handful of jobs the app makes tedious — searching an old thread, saving one, emptying a topic without losing the topic.

Install telegram-tools with
pip install telegram-tools
pipx install telegram-tools
uv tool install telegram-tools
View on GitHub
8 commandsdiscover · search · archive · send · create · clear-messages · bots · doctor
discover
every chat, channel and forum topic, with its real ID
search
find or export messages by text, sender, date or topic
archive
keep a local copy of your chats and search it offline
send
post a message or a file into a chat or a topic
create
make a group, a channel, or a topic inside one
clear-messages
empty a forum topic without deleting the topic
bots
list the bots you own and edit their settings
doctor
check your setup, printing no secrets

discord-tools

The same idea, for your own Discord servers.

Discord makes you set a bot up through a developer portal before you can do anything. This walks you through it once, then gives you the same set of jobs: IDs, members, history, sending, creating, clearing.

Install discord-tools with
pip install discord-tools-cli
pipx install discord-tools-cli
uv tool install discord-tools-cli
View on GitHub
11 commandsauth · discover · members · search · archive · send · message · create · clear-messages · bot · doctor
auth
a guided walk through the Developer Portal
discover
every server, channel and thread, with its real ID
members
list a server's members and their IDs
search
find or export a channel's messages
archive
keep a local copy of the history and search it offline
send
post as the bot, after showing you the message
message
reply, edit, react, pin, forward, copy, poll, or delete a chosen few
create
make a channel, a category, or a thread
clear-messages
clear one channel or a whole server
bot
show and edit the bot's own settings
doctor
check the token, the intent and the permissions