diff --git a/docs/channels/telegram.md b/docs/channels/telegram.md index 3a6695026..86eebc24d 100644 --- a/docs/channels/telegram.md +++ b/docs/channels/telegram.md @@ -167,7 +167,7 @@ Forward any message from the group to `@userinfobot` or `@getidsbot` on Telegram **Tip:** For your own user ID, DM the bot and it will reply with your user ID (pairing message), or use `/whoami` once commands are enabled. -**Privacy note:** `@userinfobot` is a third-party bot. If you prefer, use gateway logs (`clawdbot logs`) or Telegram developer tools to find user/chat IDs. +**Privacy note:** `@userinfobot` is a third-party bot. If you prefer, add the bot to the group, send a message, and use `clawdbot logs --follow` to read `chat.id`, or use the Bot API `getUpdates`. ## Config writes By default, Telegram is allowed to write config updates triggered by channel events or `/config set|unset`. @@ -200,7 +200,22 @@ Private chats can include `message_thread_id` in some edge cases. Clawdbot keeps - `clawdbot pairing list telegram` - `clawdbot pairing approve telegram ` - Pairing is the default token exchange used for Telegram DMs. Details: [Pairing](/start/pairing) -- `channels.telegram.allowFrom` accepts numeric user IDs (recommended) or `@username` entries. It is **not** the bot username; use the human sender’s ID (get it from `@userinfobot` or the `from.id` field in the gateway log). +- `channels.telegram.allowFrom` accepts numeric user IDs (recommended) or `@username` entries. It is **not** the bot username; use the human sender’s ID. + +#### Finding your Telegram user ID +Safer (no third-party bot): +1) Start the gateway and DM your bot. +2) Run `clawdbot logs --follow` and look for `from.id`. + +Alternate (official Bot API): +1) DM your bot. +2) Fetch updates with your bot token and read `message.from.id`: + ```bash + curl "https://api.telegram.org/bot/getUpdates" + ``` + +Third-party (less private): +- DM `@userinfobot` or `@getidsbot` and use the returned user id. ### Group access diff --git a/docs/start/faq.md b/docs/start/faq.md index 543daa482..20eff130e 100644 --- a/docs/start/faq.md +++ b/docs/start/faq.md @@ -277,7 +277,18 @@ without WhatsApp/Telegram. ### Telegram: what goes in `allowFrom`? -`channels.telegram.allowFrom` is **the human sender’s Telegram user ID** (numeric, recommended) or `@username`. It is not the bot username. To find your ID, DM `@userinfobot` or read the `from.id` in the gateway log for a DM. See [/channels/telegram](/channels/telegram#access-control-dms--groups). +`channels.telegram.allowFrom` is **the human sender’s Telegram user ID** (numeric, recommended) or `@username`. It is not the bot username. + +Safer (no third-party bot): +- DM your bot, then run `clawdbot logs --follow` and read `from.id`. + +Official Bot API: +- DM your bot, then call `https://api.telegram.org/bot/getUpdates` and read `message.from.id`. + +Third-party (less private): +- DM `@userinfobot` or `@getidsbot`. + +See [/channels/telegram](/channels/telegram#access-control-dms--groups). ### Can multiple people use one WhatsApp number with different Clawdbots?