feat: expand Telegram allowFrom guidance
Co-authored-by: Christoph Nakazawa <cpojer@users.noreply.github.com>
This commit is contained in:
@@ -468,6 +468,9 @@ AI/vibe-coded PRs welcome! 🤖
|
|||||||
|
|
||||||
Special thanks to @andrewting19 for the Anthropic OAuth tool-name fix.
|
Special thanks to @andrewting19 for the Anthropic OAuth tool-name fix.
|
||||||
|
|
||||||
|
Core contributors:
|
||||||
|
- @cpojer — Telegram onboarding UX + docs
|
||||||
|
|
||||||
Thanks to all clawtributors:
|
Thanks to all clawtributors:
|
||||||
|
|
||||||
<p align="left">
|
<p align="left">
|
||||||
|
|||||||
@@ -43,6 +43,19 @@ async function noteTelegramTokenHelp(prompter: WizardPrompter): Promise<void> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function noteTelegramUserIdHelp(prompter: WizardPrompter): Promise<void> {
|
||||||
|
await prompter.note(
|
||||||
|
[
|
||||||
|
"1) DM your bot, then read from.id in `clawdbot logs --follow` (safest)",
|
||||||
|
"2) Or call https://api.telegram.org/bot<bot_token>/getUpdates and read message.from.id",
|
||||||
|
"3) Third-party: DM @userinfobot or @getidsbot",
|
||||||
|
`Docs: ${formatDocsLink("/telegram")}`,
|
||||||
|
"Website: https://clawd.bot",
|
||||||
|
].join("\n"),
|
||||||
|
"Telegram user id",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
async function promptTelegramAllowFrom(params: {
|
async function promptTelegramAllowFrom(params: {
|
||||||
cfg: ClawdbotConfig;
|
cfg: ClawdbotConfig;
|
||||||
prompter: WizardPrompter;
|
prompter: WizardPrompter;
|
||||||
@@ -51,6 +64,7 @@ async function promptTelegramAllowFrom(params: {
|
|||||||
const { cfg, prompter, accountId } = params;
|
const { cfg, prompter, accountId } = params;
|
||||||
const resolved = resolveTelegramAccount({ cfg, accountId });
|
const resolved = resolveTelegramAccount({ cfg, accountId });
|
||||||
const existingAllowFrom = resolved.config.allowFrom ?? [];
|
const existingAllowFrom = resolved.config.allowFrom ?? [];
|
||||||
|
await noteTelegramUserIdHelp(prompter);
|
||||||
const entry = await prompter.text({
|
const entry = await prompter.text({
|
||||||
message: "Telegram allowFrom (user id)",
|
message: "Telegram allowFrom (user id)",
|
||||||
placeholder: "123456789",
|
placeholder: "123456789",
|
||||||
|
|||||||
Reference in New Issue
Block a user