Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions skills/.curated/telegram-admin/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
86 changes: 86 additions & 0 deletions skills/.curated/telegram-admin/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
name: telegram-admin
description: Use when you need to perform destructive or high-risk Telegram operations through a bundled Telethon CLI with explicit preview and confirmation steps; covers delete, leave, remove-contact, and delete-draft workflows.
metadata:
short-description: Destructive Telegram workflows with preview and confirm
---

# Telegram Admin

Use this skill when the user needs destructive or high-risk Telegram actions and mistakes are expensive.

## When to use

- deleting messages
- leaving chats or deleting dialogs
- removing contacts
- deleting drafts
- any bulk change where a wrong target is costly

## Skill paths

```bash
export CODEX_HOME="${CODEX_HOME:-$HOME/.codex}"
export TG_ADMIN="$CODEX_HOME/skills/telegram-admin/scripts/tg.py"
```

## Dependencies

Install dependencies only if they are missing:

```bash
uv pip install telethon python-dotenv
```

Fallback:

```bash
python3 -m pip install telethon python-dotenv
```

## Environment

- `TELEGRAM_API_ID`
- `TELEGRAM_API_HASH`
- `TELEGRAM_SESSION_STRING`

If the session is missing, bootstrap it with:

```bash
python "$TG_ADMIN" auth login --json
```

## Required workflow

1. Validate the current session:
`python "$TG_ADMIN" auth validate --json`
2. Resolve or inspect every target first.
3. Run a preview with `--dry-run` whenever the command supports it.
4. Only then perform the real action with `--yes`.
5. Keep `--json` enabled for all destructive commands.

## Commands

```bash
python "$TG_ADMIN" dialogs resolve --target <chat_or_user> --json
python "$TG_ADMIN" messages delete --chat <chat> --ids 123 124 --dry-run --json
python "$TG_ADMIN" messages delete --chat <chat> --ids 123 124 --yes --json
python "$TG_ADMIN" chats leave --target <chat> --dry-run --json
python "$TG_ADMIN" chats leave --target <chat> --yes --json
python "$TG_ADMIN" contacts remove --target <user> --dry-run --json
python "$TG_ADMIN" contacts remove --target <user> --yes --json
python "$TG_ADMIN" drafts delete --chat <chat> --dry-run --json
python "$TG_ADMIN" drafts delete --chat <chat> --yes --json
```

## Guardrails

- Never skip resolve or inspect.
- For bulk operations, show the target list and ids first.
- If similar names make a target ambiguous, switch to numeric ids.
- Do not replace `--dry-run` with reasoning; get a real CLI preview first.
- If the task is not destructive, prefer `telegram-safe`.

## References

- Setup and dependency guidance: `references/setup.md`
4 changes: 4 additions & 0 deletions skills/.curated/telegram-admin/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
interface:
display_name: "Telegram Admin"
short_description: "Delete or remove Telegram entities safely"
default_prompt: "Use $telegram-admin to preview and execute a destructive Telegram workflow with explicit confirmation."
39 changes: 39 additions & 0 deletions skills/.curated/telegram-admin/references/setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Telegram Admin Setup

## Dependencies

Install runtime dependencies:

```bash
uv pip install telethon python-dotenv
```

Fallback:

```bash
python3 -m pip install telethon python-dotenv
```

## Environment variables

```env
TELEGRAM_API_ID=123456
TELEGRAM_API_HASH=your_api_hash_here
TELEGRAM_SESSION_STRING=
```

## Session bootstrap

Use the bundled CLI to authenticate:

```bash
python scripts/tg.py auth login --json
```

## Destructive workflow rules

- Validate the session first.
- Resolve the target first.
- Use `--dry-run` first where supported.
- Re-run with `--yes` only after verifying ids and target.
- Keep `--json` enabled so the result stays machine-readable.
Loading