惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Y
Y Combinator Blog
G
Google Developers Blog
Vercel News
Vercel News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Jina AI
Jina AI
Blog — PlanetScale
Blog — PlanetScale
H
Help Net Security
博客园 - 三生石上(FineUI控件)
MongoDB | Blog
MongoDB | Blog
S
SegmentFault 最新的问题
阮一峰的网络日志
阮一峰的网络日志
H
Hackread – Cybersecurity News, Data Breaches, AI and More
aimingoo的专栏
aimingoo的专栏
T
Tailwind CSS Blog
博客园 - 叶小钗
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
Microsoft Security Blog
Microsoft Security Blog
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
云风的 BLOG
云风的 BLOG

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
refactor(telegram): use grammY native helpers · openclaw/...
obviyus · 2026-05-07 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -1,57 +1,9 @@

1-

import * as grammy from "grammy";

1+

import { API_CONSTANTS } from "grammy";

22
3-

const FALLBACK_ALL_UPDATE_TYPES = [

4-

"message",

5-

"edited_message",

6-

"channel_post",

7-

"edited_channel_post",

8-

"business_connection",

9-

"business_message",

10-

"edited_business_message",

11-

"deleted_business_messages",

12-

"message_reaction",

13-

"message_reaction_count",

14-

"inline_query",

15-

"chosen_inline_result",

16-

"callback_query",

17-

"shipping_query",

18-

"pre_checkout_query",

19-

"poll",

20-

"poll_answer",

21-

"my_chat_member",

22-

"chat_member",

23-

"chat_join_request",

24-

] as const;

25-
26-

const FALLBACK_DEFAULT_UPDATE_TYPES = [

27-

"message",

28-

"edited_message",

29-

"channel_post",

30-

"edited_channel_post",

31-

"business_connection",

32-

"business_message",

33-

"edited_business_message",

34-

"deleted_business_messages",

35-

"message_reaction",

36-

"message_reaction_count",

37-

"inline_query",

38-

"chosen_inline_result",

39-

"callback_query",

40-

"shipping_query",

41-

"pre_checkout_query",

42-

"poll",

43-

"poll_answer",

44-

"my_chat_member",

45-

"chat_member",

46-

"chat_join_request",

47-

] as const;

48-
49-

export type TelegramUpdateType =

50-

| (typeof FALLBACK_ALL_UPDATE_TYPES)[number]

51-

| (typeof grammy.API_CONSTANTS.ALL_UPDATE_TYPES)[number];

3+

export type TelegramUpdateType = (typeof API_CONSTANTS.ALL_UPDATE_TYPES)[number];

524
535

export const DEFAULT_TELEGRAM_UPDATE_TYPES: ReadonlyArray<TelegramUpdateType> =

54-

grammy.API_CONSTANTS?.DEFAULT_UPDATE_TYPES ?? FALLBACK_DEFAULT_UPDATE_TYPES;

6+

API_CONSTANTS.DEFAULT_UPDATE_TYPES;

557
568

export function resolveTelegramAllowedUpdates(): ReadonlyArray<TelegramUpdateType> {

579

const updates = [...DEFAULT_TELEGRAM_UPDATE_TYPES] as TelegramUpdateType[];

Original file line numberDiff line numberDiff line change

@@ -1,7 +1,7 @@

11

import { createServer } from "node:http";

22

import type { IncomingMessage } from "node:http";

33

import net from "node:net";

4-

import * as grammy from "grammy";

4+

import { InputFile } from "grammy";

55

import type { ChannelAccountSnapshot } from "openclaw/plugin-sdk/channel-contract";

66

import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";

77

import { isDiagnosticsEnabled } from "openclaw/plugin-sdk/diagnostic-runtime";

@@ -46,13 +46,6 @@ const TELEGRAM_WEBHOOK_REGISTRATION_RETRY_POLICY: BackoffPolicy = {

4646

factor: 2,

4747

jitter: 0.2,

4848

};

49-

const InputFileCtor: typeof grammy.InputFile =

50-

typeof grammy.InputFile === "function"

51-

? grammy.InputFile

52-

: (class InputFileFallback {

53-

constructor(public readonly path: string) {}

54-

} as unknown as typeof grammy.InputFile);

55-
5649

async function listenHttpServer(params: {

5750

server: ReturnType<typeof createServer>;

5851

port: number;

@@ -462,7 +455,7 @@ export async function startTelegramWebhook(opts: {

462455

bot.api.setWebhook(publicUrl, {

463456

secret_token: secret,

464457

allowed_updates: resolveTelegramAllowedUpdates(),

465-

certificate: opts.webhookCertPath ? new InputFileCtor(opts.webhookCertPath) : undefined,

458+

certificate: opts.webhookCertPath ? new InputFile(opts.webhookCertPath) : undefined,

466459

}),

467460

});

468461

} catch (err) {