fix(telegram): extract bot info contract

This commit is contained in:
Peter Steinberger
2026-05-03 16:11:30 +01:00
parent e4a6eac595
commit c74bbdd1ff
5 changed files with 20 additions and 20 deletions

View File

@@ -0,0 +1,16 @@
export type TelegramBotInfo = {
id: number;
is_bot: true;
first_name: string;
last_name?: string;
username: string;
language_code?: string;
can_join_groups: boolean;
can_read_all_group_messages: boolean;
can_manage_bots: boolean;
supports_inline_queries: boolean;
can_connect_to_business: boolean;
has_main_web_app: boolean;
has_topics_enabled: boolean;
allows_users_to_create_topics: boolean;
};

View File

@@ -1,25 +1,9 @@
import type { OpenClawConfig, ReplyToMode } from "openclaw/plugin-sdk/config-types";
import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
import type { TelegramBotDeps } from "./bot-deps.js";
import type { TelegramBotInfo } from "./bot-info.js";
import type { TelegramTransport } from "./fetch.js";
export type TelegramBotInfo = {
id: number;
is_bot: true;
first_name: string;
last_name?: string;
username: string;
language_code?: string;
can_join_groups: boolean;
can_read_all_group_messages: boolean;
can_manage_bots: boolean;
supports_inline_queries: boolean;
can_connect_to_business: boolean;
has_main_web_app: boolean;
has_topics_enabled: boolean;
allows_users_to_create_topics: boolean;
};
export type TelegramBotOptions = {
token: string;
accountId?: string;

View File

@@ -40,7 +40,7 @@ import { resolveTelegramAutoThreadId } from "./action-threading.js";
import { lookupTelegramChatId } from "./api-fetch.js";
import { telegramApprovalCapability } from "./approval-native.js";
import * as auditModule from "./audit.js";
import type { TelegramBotInfo } from "./bot.types.js";
import type { TelegramBotInfo } from "./bot-info.js";
import { buildTelegramGroupPeerId } from "./bot/helpers.js";
import { telegramMessageActions as telegramMessageActionsImpl } from "./channel-actions.js";
import {

View File

@@ -4,7 +4,7 @@ import type {
} from "openclaw/plugin-sdk/channel-contract";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
import type { TelegramBotInfo } from "./bot.types.js";
import type { TelegramBotInfo } from "./bot-info.js";
export type MonitorTelegramOpts = {
token?: string;

View File

@@ -2,7 +2,7 @@ import type { BaseProbeResult } from "openclaw/plugin-sdk/channel-contract";
import type { TelegramNetworkConfig } from "openclaw/plugin-sdk/config-types";
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
import { fetchWithTimeout } from "openclaw/plugin-sdk/text-runtime";
import type { TelegramBotInfo } from "./bot.types.js";
import type { TelegramBotInfo } from "./bot-info.js";
import { resolveTelegramApiBase, resolveTelegramFetch } from "./fetch.js";
import { makeProxyFetch } from "./proxy.js";