Skip to content

Conversation

@BayramAnnakov
Copy link
Contributor

Summary

Adds three new tools for managing Telegram drafts:

  • save_draft(chat_id, message, reply_to_msg_id, no_webpage): Save a draft message to any chat/channel. The draft appears in Telegram's input field when you open that chat, allowing review before sending.
  • get_drafts(): List all draft messages across all chats with metadata (message, date, reply info).
  • clear_draft(chat_id): Clear/delete a draft from a specific chat.

Implementation

Uses Telethon's native draft APIs:

  • SaveDraftRequest for saving/clearing drafts
  • GetAllDraftsRequest for listing all drafts

Use Case

This enables AI assistants to prepare channel/chat posts for human review before publishing - useful for content workflows where posts should be reviewed before sending.

Test Plan

  • Tested save_draft - draft appears in Telegram app input field
  • Tested get_drafts - returns list of all drafts
  • Tested clear_draft - draft is removed from chat
  • Code passes black formatting
  • Code passes flake8 linting
  • Updated README.md with new tools documentation

🤖 Generated with Claude Code

Add three new tools for managing Telegram drafts:
- save_draft: Save a draft message to any chat/channel
- get_drafts: List all drafts across all chats
- clear_draft: Clear a draft from a specific chat

Uses Telethon's SaveDraftRequest and GetAllDraftsRequest APIs.
Drafts appear in Telegram's input field for review before sending.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@chigwell chigwell merged commit 3d8027f into chigwell:main Dec 26, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants