पेयरिंग
चैनल समस्या निवारण
Gateway कॉन्फ़िगरेशन
त्वरित सेटअप
BotFather में bot token बनाएं
@BotFather है)।/newbot चलाएं, संकेतों का पालन करें, और token सहेजें।token और DM नीति कॉन्फ़िगर करें
TELEGRAM_BOT_TOKEN=... (केवल डिफ़ॉल्ट खाता)।
Telegram openclaw channels login telegram का उपयोग नहीं करता; config/env में token कॉन्फ़िगर करें, फिर gateway शुरू करें।bot को समूह में जोड़ें
- आपका Telegram उपयोगकर्ता ID, जिसका उपयोग
allowFrom/groupAllowFromमें होता है - Telegram समूह chat ID, जिसका उपयोग
channels.telegram.groupsके अंतर्गत key के रूप में होता है
openclaw logs --follow, किसी forwarded-ID bot, या Bot API getUpdates से प्राप्त करें। समूह को अनुमति मिलने के बाद, /whoami@<bot_username> उपयोगकर्ता और समूह ID की पुष्टि कर सकता है।-100 से शुरू होने वाले नकारात्मक Telegram supergroup ID समूह chat ID होते हैं। उन्हें groupAllowFrom के अंतर्गत नहीं, बल्कि channels.telegram.groups के अंतर्गत रखें।TELEGRAM_BOT_TOKEN केवल डिफ़ॉल्ट खाते पर लागू होता है।
सफल startup के बाद, OpenClaw bot पहचान को state directory में 24 घंटे तक cache करता है ताकि restart अतिरिक्त Telegram getMe call से बच सकें; token बदलने या हटाने से वह cache साफ़ हो जाता है।Telegram पक्ष की सेटिंग
Privacy mode और समूह दृश्यता
Privacy mode और समूह दृश्यता
/setprivacyके माध्यम से privacy mode अक्षम करें, या- bot को समूह admin बनाएं।
समूह अनुमतियां
समूह अनुमतियां
उपयोगी BotFather toggles
उपयोगी BotFather toggles
- समूह में जोड़े जाने की अनुमति/मनाही के लिए
/setjoingroups - समूह दृश्यता व्यवहार के लिए
/setprivacy
पहुंच नियंत्रण और सक्रियण
समूह bot पहचान
Telegram समूहों और forum topics में, कॉन्फ़िगर किए गए bot handle (उदाहरण के लिए@my_bot) का स्पष्ट mention चयनित OpenClaw agent को संबोधित करने के रूप में माना जाता है, भले ही agent persona name Telegram username से अलग हो। समूह silence policy असंबंधित समूह traffic पर फिर भी लागू होती है, लेकिन bot handle स्वयं “कोई और” नहीं माना जाता।
- DM नीति
- समूह नीति और allowlists
- Mention व्यवहार
channels.telegram.dmPolicy direct message access नियंत्रित करता है:pairing(डिफ़ॉल्ट)allowlist(allowFromमें कम से कम एक sender ID आवश्यक)open(allowFromमें"*"शामिल होना आवश्यक)disabled
allowFrom: ["*"] के साथ dmPolicy: "open" किसी भी Telegram खाते को, जो bot username ढूंढता या अनुमान लगाता है, bot को command देने देता है। इसका उपयोग केवल जानबूझकर public bots के लिए करें जिनके tools कड़ाई से प्रतिबंधित हों; one-owner bots को numeric user IDs के साथ allowlist का उपयोग करना चाहिए।channels.telegram.allowFrom numeric Telegram user IDs स्वीकार करता है। telegram: / tg: prefixes स्वीकार किए जाते हैं और normalized होते हैं।
multi-account configs में, restrictive top-level channels.telegram.allowFrom को safety boundary माना जाता है: account-level allowFrom: ["*"] entries उस account को public नहीं बनातीं जब तक effective account allowlist में merging के बाद भी explicit wildcard न हो।
खाली allowFrom के साथ dmPolicy: "allowlist" सभी DMs को block करता है और config validation द्वारा reject किया जाता है।
Setup केवल numeric user IDs पूछता है।
यदि आपने upgrade किया है और आपके config में @username allowlist entries हैं, तो उन्हें resolve करने के लिए openclaw doctor --fix चलाएं (best-effort; Telegram bot token आवश्यक)।
यदि आप पहले pairing-store allowlist files पर निर्भर थे, तो openclaw doctor --fix allowlist flows में entries को channels.telegram.allowFrom में recover कर सकता है (उदाहरण के लिए जब dmPolicy: "allowlist" में अभी explicit IDs न हों)।one-owner bots के लिए, access policy को config में टिकाऊ रखने के लिए explicit numeric allowFrom IDs के साथ dmPolicy: "allowlist" को प्राथमिकता दें (previous pairing approvals पर निर्भर रहने के बजाय)।सामान्य भ्रम: DM pairing approval का अर्थ “यह sender हर जगह authorized है” नहीं है।
Pairing DM access देती है। यदि अभी तक कोई command owner मौजूद नहीं है, तो पहली approved pairing commands.ownerAllowFrom भी set करती है ताकि owner-only commands और exec approvals के पास explicit operator account हो।
Group sender authorization फिर भी explicit config allowlists से आता है।
यदि आप चाहते हैं “मैं एक बार authorized हूं और DMs तथा group commands दोनों काम करें”, तो अपना numeric Telegram user ID channels.telegram.allowFrom में रखें; owner-only commands के लिए, सुनिश्चित करें कि commands.ownerAllowFrom में telegram:<your user id> शामिल हो।अपना Telegram user ID ढूंढना
अधिक सुरक्षित (बिना third-party bot):- अपने bot को DM करें।
openclaw logs --followचलाएं।from.idपढ़ें।
@userinfobot या @getidsbot।Runtime व्यवहार
- Telegram का स्वामित्व Gateway प्रक्रिया के पास होता है।
- रूटिंग निर्धारक है: Telegram inbound उत्तर Telegram को ही वापस जाते हैं (मॉडल चैनल नहीं चुनता)।
- inbound संदेश साझा चैनल envelope में reply metadata, media placeholders, और Gateway द्वारा देखे गए Telegram replies के लिए persisted reply-chain context के साथ normalize होते हैं।
- समूह sessions समूह ID से अलग रखे जाते हैं। Forum topics topics को अलग रखने के लिए
:topic:<threadId>जोड़ते हैं। - DM संदेश
message_thread_idले जा सकते हैं; OpenClaw replies के लिए इसे सुरक्षित रखता है। DM topic sessions केवल तब विभाजित होते हैं जब TelegramgetMebot के लिएhas_topics_enabled: trueरिपोर्ट करता है; अन्यथा DMs flat session पर रहते हैं। - Long polling per-chat/per-thread sequencing के साथ grammY runner का उपयोग करता है। Overall runner sink concurrency
agents.defaults.maxConcurrentका उपयोग करती है। - Multi-account startup समानांतर Telegram
getMeprobes को सीमित करता है ताकि बड़े bot fleets हर account probe को एक साथ fan out न करें। - Long polling हर Gateway प्रक्रिया के अंदर संरक्षित होती है ताकि एक समय में केवल एक active poller bot token का उपयोग कर सके। यदि आपको फिर भी
getUpdates409 conflicts दिखते हैं, तो संभवतः कोई दूसरा OpenClaw Gateway, script, या external poller वही token उपयोग कर रहा है। - Long-polling watchdog restarts default रूप से 120 seconds तक completed
getUpdatesliveness न होने पर trigger होते हैं।channels.telegram.pollingStallThresholdMsकेवल तब बढ़ाएँ जब आपका deployment लंबे समय तक चलने वाले काम के दौरान अब भी false polling-stall restarts देखता हो। value milliseconds में है और30000से600000तक allowed है; per-account overrides समर्थित हैं। - Telegram Bot API में read-receipt support नहीं है (
sendReadReceiptsलागू नहीं होता)।
channels.telegram.dm.threadReplies और channels.telegram.direct.<chatId>.threadReplies हटा दिए गए थे। upgrade के बाद अगर आपकी config में अब भी ये keys हैं, तो openclaw doctor --fix चलाएँ। DM topic routing अब Telegram getMe.has_topics_enabled से मिलने वाली bot capability का पालन करती है, जिसे BotFather threaded mode नियंत्रित करता है: topics-enabled bots thread-scoped DM sessions का उपयोग करते हैं जब Telegram message_thread_id भेजता है; अन्य DMs flat session पर रहते हैं।Feature reference
Live stream preview (message edits)
Live stream preview (message edits)
- direct chats: preview message +
editMessageText - groups/topics: preview message +
editMessageText
channels.telegram.streamingoff | partial | block | progressहै (default:partial)- छोटे initial answer previews debounced होते हैं, फिर run अब भी active होने पर bounded delay के बाद materialize किए जाते हैं
progresstool progress के लिए एक editable status draft रखता है, tool progress से पहले answer activity आने पर stable status label दिखाता है, completion पर इसे clear करता है, और final answer को सामान्य message के रूप में भेजता हैstreaming.preview.toolProgressनियंत्रित करता है कि tool/progress updates वही edited preview message फिर से उपयोग करें या नहीं (default:trueजब preview streaming active हो)streaming.preview.commandTextउन tool-progress lines के अंदर command/exec detail नियंत्रित करता है:raw(default, released behavior सुरक्षित रखता है) याstatus(केवल tool label)streaming.progress.commentary(default:false) temporary progress draft में assistant commentary/preamble text को opt in करता है- legacy
channels.telegram.streamMode, booleanstreamingvalues, और retired native draft preview keys detect किए जाते हैं; उन्हें current streaming config में migrate करने के लिएopenclaw doctor --fixचलाएँ
v2026.4.22 और बाद के released OpenClaw behavior से मेल रहे।answer text के लिए edited preview बनाए रखने लेकिन tool-progress lines छिपाने के लिए, set करें:progress mode का उपयोग करें जब आप final answer को उसी message में edit किए बिना visible tool progress चाहते हों। command-text policy को streaming.progress के अंतर्गत रखें:streaming.mode: "off" का उपयोग केवल तब करें जब आप final-only delivery चाहते हों: Telegram preview edits disabled होते हैं और generic tool/progress chatter को standalone status messages के रूप में भेजने के बजाय suppress किया जाता है। Approval prompts, media payloads, और errors अब भी सामान्य final delivery से route होते हैं। streaming.preview.toolProgress: false का उपयोग तब करें जब आप tool-progress status lines छिपाते हुए केवल answer preview edits बनाए रखना चाहते हों।replyToMode "first", "all", या "batched" हो और inbound message में selected quote text शामिल हो, OpenClaw answer preview को edit करने के बजाय Telegram के native quote-reply path से final answer भेजता है, इसलिए streaming.preview.toolProgress उस turn के लिए छोटी status lines नहीं दिखा सकता। selected quote text के बिना current-message replies अब भी preview streaming रखते हैं। जब tool-progress visibility native quote replies से अधिक महत्वपूर्ण हो, तो replyToMode: "off" set करें, या trade-off स्वीकार करने के लिए streaming.preview.toolProgress: false set करें।- छोटे DM/group/topic previews: OpenClaw वही preview message रखता है और final edit in place करता है
- लंबे text finals जो कई Telegram messages में split होते हैं, संभव होने पर existing preview को first final chunk के रूप में reuse करते हैं, फिर केवल remaining chunks भेजते हैं
- progress-mode finals status draft clear करते हैं और draft को answer में edit करने के बजाय normal final delivery का उपयोग करते हैं
- अगर completed text confirm होने से पहले final edit fail हो जाता है, OpenClaw normal final delivery का उपयोग करता है और stale preview clean up करता है
/reasoning streamsupported channel के reasoning-preview path का उपयोग करता है; Telegram पर, यह generate करते समय reasoning को live preview में stream करता है- final delivery के बाद reasoning preview delete कर दिया जाता है; जब reasoning visible रहना चाहिए,
/reasoning onका उपयोग करें - final answer reasoning text के बिना भेजा जाता है
Rich message formatting
Rich message formatting
channels.telegram.richMessages: true set करें:- agent को बताया जाता है कि इस bot/account के लिए Telegram rich messages available हैं।
- Markdown text OpenClaw के Markdown IR से render होता है और Telegram rich HTML के रूप में भेजा जाता है।
- Explicit rich HTML payloads supported Bot API 10.1 tags जैसे headings, tables, details, rich media, और formulas को preserve करते हैं।
- Media captions अब भी Telegram HTML captions का उपयोग करते हैं क्योंकि rich messages captions को replace नहीं करते।
$400-600K जैसी currency math के रूप में parse नहीं होती। Long rich text automatically Telegram के rich text और rich block limits में split हो जाता है। Telegram की column limit से ऊपर की tables code blocks के रूप में भेजी जाती हैं।Default: client compatibility के लिए off। Rich messages को compatible Telegram clients चाहिए; कुछ current Desktop, Web, Android, और third-party clients accepted rich messages को unsupported के रूप में दिखाते हैं। जब तक bot के साथ उपयोग किए जाने वाले हर client उन्हें render न कर सके, इस option को disabled रखें। /status दिखाता है कि current Telegram session में rich messages on हैं या off।Link previews default रूप से enabled हैं। channels.telegram.linkPreview: false rich text के लिए automatic entity detection skip करता है।Native commands and custom commands
Native commands and custom commands
setMyCommands से handle किया जाता है।Native command defaults:commands.native: "auto"Telegram के लिए native commands enable करता है
- names normalized होते हैं (leading
/strip, lowercase) - valid pattern:
a-z,0-9,_, length1..32 - custom commands native commands को override नहीं कर सकते
- conflicts/duplicates skip और log किए जाते हैं
- custom commands केवल menu entries हैं; वे behavior auto-implement नहीं करते
- plugin/skill commands typed होने पर अब भी काम कर सकते हैं, भले ही Telegram menu में न दिखें
BOT_COMMANDS_TOO_MUCHके साथsetMyCommands failedका मतलब है कि trimming के बाद भी Telegram menu overflow हुआ; plugin/skill/custom commands घटाएँ याchannels.telegram.commands.nativedisable करें।- direct Bot API curl commands काम करने के दौरान
deleteWebhook,deleteMyCommands, याsetMyCommandsका404: Not Foundके साथ fail होना यह बता सकता है किchannels.telegram.apiRootfull/bot<TOKEN>endpoint पर set था।apiRootकेवल Bot API root होना चाहिए, औरopenclaw doctor --fixaccidental trailing/bot<TOKEN>हटाता है। getMe returned 401का मतलब है कि Telegram ने configured bot token reject किया। current BotFather token के साथbotToken,tokenFile, याTELEGRAM_BOT_TOKENupdate करें; OpenClaw polling से पहले रुक जाता है, इसलिए इसे webhook cleanup failure के रूप में report नहीं किया जाता।- network/fetch errors के साथ
setMyCommands failedका मतलब आम तौर पर outbound DNS/HTTPS toapi.telegram.orgblocked है।
Device pairing commands (device-pair plugin)
जब device-pair plugin installed हो:/pairsetup code generate करता है- code iOS app में paste करें
/pair pendingpending requests list करता है (role/scopes सहित)- request approve करें:
- explicit approval के लिए
/pair approve <requestId> - जब केवल एक pending request हो तो
/pair approve - सबसे recent के लिए
/pair approve latest
- explicit approval के लिए
scopes: [] के साथ durable node token लौटाता है। यह handed-off operator token नहीं लौटाता; operator access के लिए अलग approved operator pairing या token flow चाहिए।यदि device changed auth details (उदाहरण के लिए role/scopes/public key) के साथ retry करता है, तो previous pending request supersede हो जाती है और new request अलग requestId का उपयोग करती है। approve करने से पहले /pair pending फिर से चलाएँ।अधिक विवरण: पेयरिंग.इनलाइन बटन
इनलाइन बटन
एजेंट और ऑटोमेशन के लिए Telegram संदेश कार्रवाइयां
एजेंट और ऑटोमेशन के लिए Telegram संदेश कार्रवाइयां
sendMessage(to,content, वैकल्पिकmediaUrl,replyToMessageId,messageThreadId)react(chatId,messageId,emoji)deleteMessage(chatId,messageId)editMessage(chatId,messageId,contentयाcaption, वैकल्पिकpresentationइनलाइन बटन; केवल-बटन संपादन रिप्लाई मार्कअप अपडेट करते हैं)createForumTopic(chatId,name, वैकल्पिकiconColor,iconCustomEmojiId)
send, react, delete, edit, sticker, sticker-search, topic-create)।गेटिंग नियंत्रण:channels.telegram.actions.sendMessagechannels.telegram.actions.deleteMessagechannels.telegram.actions.reactionschannels.telegram.actions.sticker(डिफ़ॉल्ट: अक्षम)
edit और topic-create वर्तमान में डिफ़ॉल्ट रूप से सक्षम हैं और इनके लिए अलग channels.telegram.actions.* टॉगल नहीं हैं।
रनटाइम भेजने की कार्रवाइयां सक्रिय कॉन्फ़िग/सीक्रेट्स स्नैपशॉट (स्टार्टअप/रीलोड) का उपयोग करती हैं, इसलिए कार्रवाई पथ हर भेजने पर तदर्थ SecretRef री-रिज़ॉल्यूशन नहीं करते।रिएक्शन हटाने की सिमेंटिक्स: /tools/reactionsरिप्लाई थ्रेडिंग टैग
रिप्लाई थ्रेडिंग टैग
[[reply_to_current]]ट्रिगर करने वाले संदेश का रिप्लाई करता है[[reply_to:<id>]]किसी विशिष्ट Telegram संदेश ID का रिप्लाई करता है
channels.telegram.replyToMode हैंडलिंग नियंत्रित करता है:off(डिफ़ॉल्ट)firstall
off निहित रिप्लाई थ्रेडिंग को अक्षम करता है। स्पष्ट [[reply_to_*]] टैग फिर भी मान्य रहते हैं।फ़ोरम टॉपिक और थ्रेड व्यवहार
फ़ोरम टॉपिक और थ्रेड व्यवहार
- टॉपिक सेशन कुंजियां
:topic:<threadId>जोड़ती हैं - रिप्लाई और टाइपिंग टॉपिक थ्रेड को लक्षित करते हैं
- टॉपिक कॉन्फ़िग पथ:
channels.telegram.groups.<chatId>.topics.<threadId>
threadId=1) विशेष-केस:- संदेश भेजना
message_thread_idछोड़ देता है (TelegramsendMessage(...thread_id=1)को अस्वीकार करता है) - टाइपिंग कार्रवाइयां फिर भी
message_thread_idशामिल करती हैं
requireMention, allowFrom, skills, systemPrompt, enabled, groupPolicy)।
agentId केवल-टॉपिक है और समूह डिफ़ॉल्ट से इनहेरिट नहीं होता।
topics."*" उस समूह के हर टॉपिक के लिए डिफ़ॉल्ट सेट करता है; सटीक टॉपिक ID फिर भी "*" पर प्राथमिकता रखते हैं।प्रति-टॉपिक एजेंट रूटिंग: टॉपिक कॉन्फ़िग में agentId सेट करके हर टॉपिक किसी अलग एजेंट को रूट कर सकता है। इससे हर टॉपिक को अपना अलग वर्कस्पेस, मेमरी और सेशन मिलता है। उदाहरण:agent:zu:telegram:group:-1001234567890:topic:3स्थायी ACP टॉपिक बाइंडिंग: फ़ोरम टॉपिक टॉप-लेवल टाइप्ड ACP बाइंडिंग (bindings[] जिसमें type: "acp" और match.channel: "telegram", peer.kind: "group", और -1001234567890:topic:42 जैसी टॉपिक-योग्य ID हो) के माध्यम से ACP हार्नेस सेशन पिन कर सकते हैं। वर्तमान में समूहों/सुपरग्रुप में फ़ोरम टॉपिक तक सीमित। ACP एजेंट देखें।चैट से थ्रेड-बाउंड ACP स्पॉन: /acp spawn <agent> --thread here|auto वर्तमान टॉपिक को नए ACP सेशन से बांधता है; आगे के संदेश सीधे वहीं रूट होते हैं। OpenClaw स्पॉन पुष्टि को टॉपिक में पिन करता है। channels.telegram.threadBindings.spawnSessions का सक्षम रहना आवश्यक है (डिफ़ॉल्ट: true)।टेम्पलेट संदर्भ MessageThreadId और IsForum उजागर करता है। message_thread_id वाली DM चैट रिप्लाई मेटाडेटा रखती हैं; वे थ्रेड-अवेयर सेशन कुंजियों का उपयोग केवल तब करती हैं जब Telegram getMe bot के लिए has_topics_enabled: true रिपोर्ट करता है।
पुराने dm.threadReplies और direct.*.threadReplies ओवरराइड जानबूझकर हटाए गए हैं; BotFather थ्रेडेड मोड को सत्य का एकमात्र स्रोत मानें और पुराने कॉन्फ़िग कुंजियां हटाने के लिए openclaw doctor --fix चलाएं।ऑडियो, वीडियो और स्टिकर
ऑडियो, वीडियो और स्टिकर
ऑडियो संदेश
Telegram वॉयस नोट और ऑडियो फ़ाइलों में अंतर करता है।- डिफ़ॉल्ट: ऑडियो फ़ाइल व्यवहार
- एजेंट रिप्लाई में टैग
[[audio_as_voice]]वॉयस-नोट भेजने को बाध्य करता है - इनबाउंड वॉयस-नोट ट्रांसक्रिप्ट एजेंट संदर्भ में मशीन-जनरेटेड, अविश्वसनीय टेक्स्ट के रूप में फ़्रेम किए जाते हैं; मेंशन डिटेक्शन फिर भी कच्चे ट्रांसक्रिप्ट का उपयोग करता है ताकि मेंशन-गेटेड वॉयस संदेश काम करते रहें।
वीडियो संदेश
Telegram वीडियो फ़ाइलों और वीडियो नोट्स में अंतर करता है।संदेश कार्रवाई उदाहरण:स्टिकर
इनबाउंड स्टिकर हैंडलिंग:- स्थिर WEBP: डाउनलोड और प्रोसेस किया गया (प्लेसहोल्डर
<media:sticker>) - एनिमेटेड TGS: छोड़ा गया
- वीडियो WEBM: छोड़ा गया
Sticker.emojiSticker.setNameSticker.fileIdSticker.fileUniqueIdSticker.cachedDescription
Reaction सूचनाएं
Reaction सूचनाएं
message_reaction updates के रूप में आते हैं (संदेश payloads से अलग)।सक्षम होने पर, OpenClaw इस तरह के सिस्टम events queue में डालता है:Telegram reaction added: 👍 by Alice (@alice) on msg 42
channels.telegram.reactionNotifications:off | own | all(डिफ़ॉल्ट:own)channels.telegram.reactionLevel:off | ack | minimal | extensive(डिफ़ॉल्ट:minimal)
ownका मतलब केवल bot द्वारा भेजे गए संदेशों पर user reactions है (sent-message cache के माध्यम से best-effort)।- Reaction events अब भी Telegram access controls (
dmPolicy,allowFrom,groupPolicy,groupAllowFrom) का पालन करते हैं; अनधिकृत senders छोड़ दिए जाते हैं। - Telegram reaction updates में thread IDs नहीं देता।
- non-forum groups group chat session पर route होते हैं
- forum groups group general-topic session (
:topic:1) पर route होते हैं, सटीक मूल topic पर नहीं
allowed_updates में message_reaction अपने-आप शामिल होता है।Ack reactions
Ack reactions
ackReaction एक acknowledgement emoji भेजता है। ackReactionScope तय करता है कि वह emoji वास्तव में कब भेजा जाता है।Emoji (ackReaction) resolution order:channels.telegram.accounts.<accountId>.ackReactionchannels.telegram.ackReactionmessages.ackReaction- agent identity emoji fallback (
agents.list[].identity.emoji, अन्यथा ”👀”)
- Telegram unicode emoji की अपेक्षा करता है (उदाहरण के लिए ”👀”)।
- किसी channel या account के लिए reaction निष्क्रिय करने हेतु
""का उपयोग करें।
messages.ackReactionScope):Telegram provider scope को messages.ackReactionScope से पढ़ता है (डिफ़ॉल्ट "group-mentions")। आज Telegram-account या Telegram-channel-level override नहीं है।मान: "all" (DMs + groups), "direct" (केवल DMs), "group-all" (हर group message, कोई DMs नहीं), "group-mentions" (groups में जब bot को mention किया जाए; कोई DMs नहीं — यही डिफ़ॉल्ट है), "off" / "none" (निष्क्रिय)।"group-mentions") direct messages में ack reactions trigger नहीं करता। inbound Telegram DMs पर ack reaction पाने के लिए, messages.ackReactionScope को "direct" या "all" पर सेट करें। मान Telegram provider startup पर पढ़ा जाता है, इसलिए बदलाव लागू करने के लिए gateway restart आवश्यक है।Telegram events और commands से config writes
Telegram events और commands से config writes
configWrites !== false)।Telegram-triggered writes में शामिल हैं:channels.telegram.groupsको update करने के लिए group migration events (migrate_to_chat_id)/config setऔर/config unset(command enablement आवश्यक)
Long polling बनाम webhook
Long polling बनाम webhook
channels.telegram.webhookUrl और channels.telegram.webhookSecret सेट करें; वैकल्पिक webhookPath, webhookHost, webhookPort (डिफ़ॉल्ट /telegram-webhook, 127.0.0.1, 8787)।long-polling mode में OpenClaw अपना restart watermark केवल तब persist करता है जब कोई update सफलतापूर्वक dispatch हो जाता है। यदि कोई handler विफल होता है, तो वह update उसी process में retryable रहता है और restart dedupe के लिए completed के रूप में नहीं लिखा जाता।local listener 127.0.0.1:8787 से bind होता है। public ingress के लिए, या तो local port के सामने reverse proxy लगाएं या जानबूझकर webhookHost: "0.0.0.0" सेट करें।Telegram को 200 लौटाने से पहले webhook mode request guards, Telegram secret token, और JSON body को validate करता है।
इसके बाद OpenClaw उसी per-chat/per-topic bot lanes के माध्यम से update को asynchronously process करता है जो long polling में उपयोग होती हैं, इसलिए slow agent turns Telegram के delivery ACK को रोके नहीं रखते।सीमाएं, पुनः प्रयास, और CLI लक्ष्य
सीमाएं, पुनः प्रयास, और CLI लक्ष्य
channels.telegram.textChunkLimitका डिफॉल्ट 4000 है।channels.telegram.chunkMode="newline"लंबाई के आधार पर विभाजन से पहले पैराग्राफ सीमाओं (खाली पंक्तियों) को प्राथमिकता देता है।channels.telegram.mediaMaxMb(डिफॉल्ट 100) आने वाले और बाहर जाने वाले Telegram मीडिया आकार को सीमित करता है।channels.telegram.mediaGroupFlushMs(डिफॉल्ट 500) नियंत्रित करता है कि Telegram एल्बम/मीडिया समूहों को OpenClaw द्वारा एक इनबाउंड संदेश के रूप में भेजने से पहले कितनी देर तक बफर किया जाता है। यदि एल्बम के हिस्से देर से आते हैं तो इसे बढ़ाएं; एल्बम जवाब की विलंबता घटाने के लिए इसे घटाएं।channels.telegram.timeoutSecondsTelegram API क्लाइंट टाइमआउट को ओवरराइड करता है (यदि सेट नहीं है, तो grammY डिफॉल्ट लागू होता है)। Bot क्लाइंट कॉन्फ़िगर किए गए मानों को 60-सेकंड के आउटबाउंड टेक्स्ट/टाइपिंग अनुरोध गार्ड से नीचे सीमित करते हैं ताकि OpenClaw का ट्रांसपोर्ट गार्ड और फॉलबैक चलने से पहले grammY दृश्य जवाब डिलीवरी को निरस्त न करे। Long polling अब भी 45-सेकंडgetUpdatesअनुरोध गार्ड का उपयोग करता है ताकि निष्क्रिय polls को अनिश्चित काल तक छोड़ा न जाए।channels.telegram.pollingStallThresholdMsका डिफॉल्ट120000है; केवल false-positive polling-stall पुनरारंभों के लिए30000और600000के बीच समायोजित करें।- समूह संदर्भ इतिहास
channels.telegram.historyLimitयाmessages.groupChat.historyLimit(डिफॉल्ट 50) का उपयोग करता है;0अक्षम करता है। - जब gateway ने parent संदेश देखे हों, तो reply/quote/forward पूरक संदर्भ को एक चयनित conversation context window में सामान्यीकृत किया जाता है; observed-message cache OpenClaw SQLite plugin state में रहता है, और
openclaw doctor --fixlegacy sidecars आयात करता है। Telegram updates में केवल एक सतहीreply_to_messageशामिल करता है, इसलिए cache से पुरानी chains Telegram के वर्तमान update payload तक सीमित होती हैं। - Telegram allowlists मुख्य रूप से नियंत्रित करती हैं कि agent को कौन trigger कर सकता है, यह पूर्ण supplemental-context redaction boundary नहीं है।
- DM इतिहास नियंत्रण:
channels.telegram.dmHistoryLimitchannels.telegram.dms["<user_id>"].historyLimit
channels.telegram.retryconfig recoverable outbound API errors के लिए Telegram send helpers (CLI/tools/actions) पर लागू होता है। इनबाउंड अंतिम-जवाब डिलीवरी Telegram pre-connect failures के लिए bounded safe-send retry भी उपयोग करती है, लेकिन यह ऐसे ambiguous post-send network envelopes को retry नहीं करती जो दृश्य संदेशों को duplicate कर सकते हैं।
openclaw message poll का उपयोग करते हैं और forum topics का समर्थन करते हैं:--poll-duration-seconds(5-600)--poll-anonymous--poll-public- forum topics के लिए
--thread-id(या:topic:target का उपयोग करें)
- जब
channels.telegram.capabilities.inlineButtonsअनुमति देता है, तो inline keyboards के लिएbuttonsblocks के साथ--presentation - जब bot उस chat में pin कर सकता है, तो pinned delivery का अनुरोध करने के लिए
--pinया--delivery '{"pin":true}' - outbound images, GIFs, और videos को compressed photo, animated-media, या video uploads के बजाय documents के रूप में भेजने के लिए
--force-document
channels.telegram.actions.sendMessage=falsepolls सहित outbound Telegram messages को अक्षम करता हैchannels.telegram.actions.poll=falseनियमित sends को सक्षम रखते हुए Telegram poll creation को अक्षम करता है
Telegram में exec approvals
Telegram में exec approvals
channels.telegram.execApprovals.enabled(जब कम से कम एक approver resolvable हो तो auto-enable होता है)channels.telegram.execApprovals.approvers(commands.ownerAllowFromसे numeric owner IDs पर fallback करता है)channels.telegram.execApprovals.target:dm(डिफॉल्ट) |channel|bothagentFilter,sessionFilter
channels.telegram.allowFrom, groupAllowFrom, और defaultTo नियंत्रित करते हैं कि bot से कौन बात कर सकता है और यह सामान्य replies कहां भेजता है। वे किसी को exec approver नहीं बनाते। जब अभी कोई command owner मौजूद नहीं होता, तो पहला approved DM pairing commands.ownerAllowFrom को bootstrap करता है, इसलिए one-owner setup अब भी execApprovals.approvers के अंतर्गत IDs duplicate किए बिना काम करता है।Channel delivery chat में command text दिखाती है; trusted groups/topics में ही channel या both enable करें। जब prompt किसी forum topic में पहुंचता है, तो OpenClaw approval prompt और follow-up के लिए topic को संरक्षित रखता है। Exec approvals डिफॉल्ट रूप से 30 मिनट बाद expire होते हैं।Inline approval buttons के लिए भी channels.telegram.capabilities.inlineButtons का target surface (dm, group, या all) को allow करना आवश्यक है। plugin: prefix वाले approval IDs plugin approvals के माध्यम से resolve होते हैं; अन्य पहले exec approvals के माध्यम से resolve होते हैं।Exec approvals देखें।Error reply controls
जब agent को delivery या provider error मिलता है, तो Telegram error text के साथ reply कर सकता है या उसे suppress कर सकता है। दो config keys इस व्यवहार को नियंत्रित करती हैं:| Key | Values | Default | Description |
|---|---|---|---|
channels.telegram.errorPolicy | reply, silent | reply | reply chat को friendly error message भेजता है। silent error replies को पूरी तरह suppress करता है। |
channels.telegram.errorCooldownMs | number (ms) | 60000 | उसी chat को error replies के बीच न्यूनतम समय। Outages के दौरान error spam रोकता है। |
समस्या निवारण
Bot non mention group messages का जवाब नहीं देता
Bot non mention group messages का जवाब नहीं देता
- यदि
requireMention=falseहै, तो Telegram privacy mode को full visibility की अनुमति देनी चाहिए।- BotFather:
/setprivacy-> Disable - फिर bot को group से हटाएं + दोबारा जोड़ें
- BotFather:
- जब config unmentioned group messages की अपेक्षा करता है, तो
openclaw channels statusचेतावनी देता है। openclaw channels status --probeexplicit numeric group IDs जांच सकता है; wildcard"*"को membership-probe नहीं किया जा सकता।- quick session test:
/activation always.
Bot group messages बिल्कुल नहीं देख रहा
Bot group messages बिल्कुल नहीं देख रहा
- जब
channels.telegram.groupsमौजूद हो, तो group सूचीबद्ध होना चाहिए (या"*"शामिल करें) - group में bot membership सत्यापित करें
- skip reasons के लिए logs देखें:
openclaw logs --follow
Commands आंशिक रूप से काम करते हैं या बिल्कुल नहीं करते
Commands आंशिक रूप से काम करते हैं या बिल्कुल नहीं करते
- अपनी sender identity authorize करें (pairing और/या numeric
allowFrom) - group policy
openहोने पर भी command authorization लागू रहता है BOT_COMMANDS_TOO_MUCHके साथsetMyCommands failedका अर्थ है कि native menu में बहुत अधिक entries हैं; plugin/skill/custom commands घटाएं या native menus अक्षम करेंdeleteMyCommands/setMyCommandsstartup calls औरsendChatActiontyping calls bounded हैं और request timeout पर Telegram के transport fallback के माध्यम से एक बार retry करते हैं। Persistent network/fetch errors आमतौर परapi.telegram.orgतक DNS/HTTPS reachability issues दर्शाते हैं
Startup unauthorized token रिपोर्ट करता है
Startup unauthorized token रिपोर्ट करता है
Polling या network instability
Polling या network instability
- Node 22+ + custom fetch/proxy, AbortSignal types mismatch होने पर immediate abort behavior trigger कर सकता है।
- कुछ hosts
api.telegram.orgको पहले IPv6 पर resolve करते हैं; broken IPv6 egress intermittent Telegram API failures का कारण बन सकता है। - यदि logs में
TypeError: fetch failedयाNetwork request for 'getUpdates' failed!शामिल है, तो OpenClaw अब इन्हें recoverable network errors के रूप में retry करता है। - polling startup के दौरान, OpenClaw grammY के लिए successful startup
getMeprobe reuse करता है ताकि runner को पहलेgetUpdatesसे पहले दूसरेgetMeकी जरूरत न पड़े। - यदि polling startup के दौरान transient network error के साथ
deleteWebhookfail होता है, तो OpenClaw दूसरा pre-poll control-plane call करने के बजाय long polling में आगे बढ़ता है। Still-active webhookgetUpdatesconflict के रूप में surface होता है; फिर OpenClaw Telegram transport rebuild करता है और webhook cleanup retry करता है। - यदि Telegram sockets short fixed cadence पर recycle होते हैं, तो low
channels.telegram.timeoutSecondsजांचें; bot clients configured values को outbound औरgetUpdatesrequest guards से नीचे clamp करते हैं, लेकिन पुराने releases हर poll या reply abort कर सकते थे जब यह उन guards से नीचे set था। - यदि logs में
Polling stall detectedशामिल है, तो OpenClaw डिफॉल्ट रूप से completed long-poll liveness के बिना 120 seconds के बाद polling restart करता है और Telegram transport rebuild करता है। - जब running polling account ने startup grace के बाद
getUpdatescomplete नहीं किया हो, running webhook account ने startup grace के बादsetWebhookcomplete नहीं किया हो, या last successful polling transport activity stale हो, तोopenclaw channels status --probeऔरopenclaw doctorचेतावनी देते हैं। channels.telegram.pollingStallThresholdMsकेवल तब बढ़ाएं जब long-runninggetUpdatescalls healthy हों लेकिन आपका host अब भी false polling-stall restarts रिपोर्ट करता हो। Persistent stalls आमतौर पर host औरapi.telegram.orgके बीच proxy, DNS, IPv6, या TLS egress issues की ओर संकेत करते हैं।- Telegram Bot API transport के लिए process proxy env का भी सम्मान करता है, जिनमें
HTTP_PROXY,HTTPS_PROXY,ALL_PROXY, और उनके lowercase variants शामिल हैं।NO_PROXY/no_proxyअब भीapi.telegram.orgको bypass कर सकते हैं। - यदि OpenClaw managed proxy किसी service environment के लिए
OPENCLAW_PROXY_URLके माध्यम से configured है और कोई standard proxy env मौजूद नहीं है, तो Telegram भी Bot API transport के लिए वही URL उपयोग करता है। - अस्थिर direct egress/TLS वाले VPS hosts पर, Telegram API calls को
channels.telegram.proxyके माध्यम से route करें:
- Node 22+ का डिफॉल्ट
autoSelectFamily=trueहै (WSL2 को छोड़कर)। Telegram DNS result order पहलेOPENCLAW_TELEGRAM_DNS_RESULT_ORDER, फिरchannels.telegram.network.dnsResultOrder, फिर process default जैसेNODE_OPTIONS=--dns-result-order=ipv4firstका सम्मान करता है; यदि कोई लागू नहीं होता, तो Node 22+ipv4firstपर fallback करता है। - यदि आपका host WSL2 है या explicit रूप से IPv4-only behavior के साथ बेहतर काम करता है, तो family selection force करें:
- RFC 2544 बेंचमार्क-रेंज उत्तर (
198.18.0.0/15) पहले से ही Telegram मीडिया डाउनलोड के लिए डिफ़ॉल्ट रूप से अनुमत हैं। यदि कोई विश्वसनीय fake-IP या पारदर्शी प्रॉक्सी मीडिया डाउनलोड के दौरानapi.telegram.orgको किसी अन्य निजी/आंतरिक/विशेष-उपयोग पते पर फिर से लिखता है, तो आप Telegram-केवल बायपास के लिए ऑप्ट इन कर सकते हैं:
- वही ऑप्ट-इन प्रति खाते पर
channels.telegram.accounts.<accountId>.network.dangerouslyAllowPrivateNetworkपर उपलब्ध है। - यदि आपकी प्रॉक्सी Telegram मीडिया होस्ट को
198.18.x.xमें रिज़ॉल्व करती है, तो पहले खतरनाक फ़्लैग बंद रखें। Telegram मीडिया पहले से ही RFC 2544 बेंचमार्क रेंज को डिफ़ॉल्ट रूप से अनुमति देता है।
- परिवेश ओवरराइड (अस्थायी):
OPENCLAW_TELEGRAM_DISABLE_AUTO_SELECT_FAMILY=1OPENCLAW_TELEGRAM_ENABLE_AUTO_SELECT_FAMILY=1OPENCLAW_TELEGRAM_DNS_RESULT_ORDER=ipv4first
- DNS उत्तर सत्यापित करें:
कॉन्फ़िगरेशन संदर्भ
प्राथमिक संदर्भ: कॉन्फ़िगरेशन संदर्भ - Telegram.उच्च-संकेत Telegram फ़ील्ड
उच्च-संकेत Telegram फ़ील्ड
- स्टार्टअप/auth:
enabled,botToken,tokenFile,accounts.*(tokenFileको नियमित फ़ाइल की ओर इंगित करना चाहिए; symlinks अस्वीकार किए जाते हैं) - पहुँच नियंत्रण:
dmPolicy,allowFrom,groupPolicy,groupAllowFrom,groups,groups.*.topics.*, शीर्ष-स्तरीयbindings[](type: "acp") - विषय डिफ़ॉल्ट:
groups.<chatId>.topics."*"unmatched forum topics पर लागू होता है; सटीक topic IDs इसे ओवरराइड करते हैं - exec अनुमोदन:
execApprovals,accounts.*.execApprovals - कमांड/मेनू:
commands.native,commands.nativeSkills,customCommands - थ्रेडिंग/उत्तर:
replyToMode - स्ट्रीमिंग:
streaming(पूर्वावलोकन),streaming.preview.toolProgress,blockStreaming - फ़ॉर्मैटिंग/डिलीवरी:
textChunkLimit,chunkMode,richMessages,linkPreview,responsePrefix - मीडिया/नेटवर्क:
mediaMaxMb,mediaGroupFlushMs,timeoutSeconds,pollingStallThresholdMs,retry,network.autoSelectFamily,network.dangerouslyAllowPrivateNetwork,proxy - कस्टम API root:
apiRoot(केवल Bot API root;/bot<TOKEN>शामिल न करें) - webhook:
webhookUrl,webhookSecret,webhookPath,webhookHost - कार्रवाइयाँ/क्षमताएँ:
capabilities.inlineButtons,actions.sendMessage|editMessage|deleteMessage|reactions|sticker - प्रतिक्रियाएँ:
reactionNotifications,reactionLevel - त्रुटियाँ:
errorPolicy,errorCooldownMs - लेखन/इतिहास:
configWrites,historyLimit,dmHistoryLimit,dms.*.historyLimit
channels.telegram.defaultAccount सेट करें (या channels.telegram.accounts.default शामिल करें)। अन्यथा OpenClaw पहले normalized account ID पर वापस जाता है और openclaw doctor चेतावनी देता है। नामित खाते channels.telegram.allowFrom / groupAllowFrom inherit करते हैं, लेकिन accounts.default.* मान नहीं।