mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:50:43 +00:00
fix(telegram): extract bot info contract
This commit is contained in:
16
extensions/telegram/src/bot-info.ts
Normal file
16
extensions/telegram/src/bot-info.ts
Normal 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;
|
||||
};
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user