Skip to content

Commit c74bbdd

Browse files
committed
fix(telegram): extract bot info contract
1 parent e4a6eac commit c74bbdd

5 files changed

Lines changed: 20 additions & 20 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export type TelegramBotInfo = {
2+
id: number;
3+
is_bot: true;
4+
first_name: string;
5+
last_name?: string;
6+
username: string;
7+
language_code?: string;
8+
can_join_groups: boolean;
9+
can_read_all_group_messages: boolean;
10+
can_manage_bots: boolean;
11+
supports_inline_queries: boolean;
12+
can_connect_to_business: boolean;
13+
has_main_web_app: boolean;
14+
has_topics_enabled: boolean;
15+
allows_users_to_create_topics: boolean;
16+
};

extensions/telegram/src/bot.types.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,9 @@
11
import type { OpenClawConfig, ReplyToMode } from "openclaw/plugin-sdk/config-types";
22
import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
33
import type { TelegramBotDeps } from "./bot-deps.js";
4+
import type { TelegramBotInfo } from "./bot-info.js";
45
import type { TelegramTransport } from "./fetch.js";
56

6-
export type TelegramBotInfo = {
7-
id: number;
8-
is_bot: true;
9-
first_name: string;
10-
last_name?: string;
11-
username: string;
12-
language_code?: string;
13-
can_join_groups: boolean;
14-
can_read_all_group_messages: boolean;
15-
can_manage_bots: boolean;
16-
supports_inline_queries: boolean;
17-
can_connect_to_business: boolean;
18-
has_main_web_app: boolean;
19-
has_topics_enabled: boolean;
20-
allows_users_to_create_topics: boolean;
21-
};
22-
237
export type TelegramBotOptions = {
248
token: string;
259
accountId?: string;

extensions/telegram/src/channel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import { resolveTelegramAutoThreadId } from "./action-threading.js";
4040
import { lookupTelegramChatId } from "./api-fetch.js";
4141
import { telegramApprovalCapability } from "./approval-native.js";
4242
import * as auditModule from "./audit.js";
43-
import type { TelegramBotInfo } from "./bot.types.js";
43+
import type { TelegramBotInfo } from "./bot-info.js";
4444
import { buildTelegramGroupPeerId } from "./bot/helpers.js";
4545
import { telegramMessageActions as telegramMessageActionsImpl } from "./channel-actions.js";
4646
import {

extensions/telegram/src/monitor.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type {
44
} from "openclaw/plugin-sdk/channel-contract";
55
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
66
import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
7-
import type { TelegramBotInfo } from "./bot.types.js";
7+
import type { TelegramBotInfo } from "./bot-info.js";
88

99
export type MonitorTelegramOpts = {
1010
token?: string;

extensions/telegram/src/probe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { BaseProbeResult } from "openclaw/plugin-sdk/channel-contract";
22
import type { TelegramNetworkConfig } from "openclaw/plugin-sdk/config-types";
33
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
44
import { fetchWithTimeout } from "openclaw/plugin-sdk/text-runtime";
5-
import type { TelegramBotInfo } from "./bot.types.js";
5+
import type { TelegramBotInfo } from "./bot-info.js";
66
import { resolveTelegramApiBase, resolveTelegramFetch } from "./fetch.js";
77
import { makeProxyFetch } from "./proxy.js";
88

0 commit comments

Comments
 (0)